Hello together,
We built a custom App Polling trigger, that is polling created invoices by date.
Now we have the problem, that the return limit of the API is 500. That means, every time 500 Invoices have been polled, we don’t get the new ones.
In the API Call, we could call it like “Give me invoices created after XXX”, but I don’t know how to get the “Last received Date” from the trigger. Is there any way, we can use that, to really only get fresh invoices?
Here is our code:
{
"url": "/Invoices/query",
"method": "GET",
"qs": {
"search" : "{\"filter\":[{\"op\":\"and\",\"items\":[{\"op\":\"exist\",\"field\":\"id\"},{\"op\":\"eq\",\"field\":\"isVoided\", \"value\": false},{\"op\":\"gt\",\"field\":\"createDateTime\", \"value\": \"{{parameters.startDateTime}}\"}]}]}"
},
"body": {},
"headers": {},
"response": {
"iterate": "{{body.items}}",
"trigger": {
"id": "{{item.id}}",
"date": "{{item.createDateTime}}",
"type": "date",
"order": "desc"
},
"output": "{{item}}",
"limit": "{{parameters.limit}}"
}
}
So Instead of using a parameter ({{parameters.startDateTime}}), we would like to have a dynamic variable, that adjusts according to the last processed item in the polling trigger.