API - Get items from board by created or updated date

Hi All,
Im new in this world and i need to :

  • From one board, extract a initial load.
  • Then, in a daily load, i need to get the updated or new records from last load using update and create date field .

I was reading a lot of post about it, but i didnt get the solution yet.

Any clue about it?
Regards

Hello @marcossuarez and welcome to the community!

I hope you like it here :muscle:

I am not sure I understand the flow you are trying to build.

You want to extract all the column values of your board and then once a day get the column values of the items that were created since the last query?

Hi Matias,

Exactly. The initial load will be the easy part…but i donde Know how can i extract the daily load extracting only the New or modified since Last load

Hello again @marcossuarez!

You can not use dates as an argument in the query. But you have a few options:

  1. Get the information using pagination and newest_first: true and check the creation date of the items. If the creation date of all retrieved items is within the last day, you continue to the next page. When you find older items, you stop and then on your end you do not use the old items.
  2. You use one group per day and then get only the items inside of a specific group.
  3. You get all of the items and then do the sorting on your end.

Those are some option I can think about.

Hope it helps!

Cheers,
Matias

Hi Matias,

Trying to apply solution #01 the newest_first works perfect, this is the code :

{
boards(ids: XXXXXXXX) {
id
name
items(newest_first: true) {
id
name
created_at
updated_at
group { title }
columns: column_values { title, text }
}
}
}

But i cannot add correctly the pagination argument in the item level, can you help me please?

REgards

Hello again @marcossuarez!

Here is an example:

{
  boards(ids: 1234567890) {
    id
    name
    items(newest_first: true, limit: 2, page: 1) {
      id
      name
      created_at
      updated_at
      group {
        title
      }
      columns: column_values {
        title
        text
      }
    }
  }
}

In this example, each page would contain 2 results (2 items). Page one would be items 1 and 2. Page 2 would be items 3 and 4. Page 3 would be items 5 and 6 and so on.

Let me know if you have any other questions :slightly_smiling_face:

Cheers,
Matias

Hi Matias, how are you?

I was testing your query and i see that the “Newest first” parameter is based on “created date” field, unfortunately i need a parameter to fetch the modified records based on “update field”, any idea about it?

Hello again @marcossuarez!

There is no such parameter for our API as of today.

You can get your items and then use the updated_at field to do the sorting on your end.

Cheers,
Matias