Hello,
We’re creating a new trigger (polling) for our custom app. Our trigger gets an array of items like this one:
{
"id": "24",
"name": "Richard",
"email": "richard@example.com",
"creation_date": "2024-01-19 15:13:20",
"active": "1",
"source": "When sending a test",
"confirmed": "1",
"confirmation_date": "2024-01-22 16:07:50",
"confirmation_ip": "127.0.0.1",
"tracking": "1",
"language": "en-US",
"last_sent_date": "2024-01-22 16:07:56",
"last_open_date": "2024-01-22 16:07:56",
"last_click_date": "2024-01-22 16:07:56",
"status": "0",
"subscription_date": "2024-01-22 16:07:56",
"unsubscribe_date": "2024-01-23 17:07:56"
}
For the trigger type, we tried “id” like this:
"trigger": {
"type": "id", // Identifies trigger polling by date.
"id": "{{item.id}}", // Identifies items by its property: "id".
"order": "unordered" // Specifies in what order the remote API returns items.
}
This works well, but it only takes the users with an ID > the ones that have already been handled. Since the route only returns the relevant users, we would like the trigger to take ALL results into account.
Is it possible? If so, what do we need to add to the trigger and where (communication, epoch, etc)?
We noticed that when right-clicking the module in a scenario we can choose where to start and select “All”, but that only applies to the first execution, the next ones revert to the behaviour I first described.
Alternatively, we tried to make the trigger into a “date” type like this since the unsubscribe_date will only “go up” each time the trigger is executed:
"trigger": {
"type": "date", // Identifies trigger polling by date.
"id": "{{item.id}}", // Identifies items by its property: "id".
"date": "{{parseDate(item.unsubscribe_date, 'yyyy-MM-dd HH:mm:ss')}}",
"order": "unordered" // Specifies in what order the remote API returns items.
}
We however couldn’t actually manage to make it work by following the documentation.
Thank you for anyone having some clue as to how to do this