Is there an equivalent to a for-in loop in Pabbly?
Status: Closed · Asked by drpx on · 0 views
I'm using pabbly to automate hotel tasks. I need to send reminders to guests that are supposed to checkout in the current day, so I set up a schedule to run everyday at 9:00AM
By 9:00, the workflow fetches an API with all guests (even the ones the aren't checking out)
The API returns a list with many objects, every object being a guest. Inside the object, there are key-values such as endDate (which is the day they are leaving)
So, I need to loop thru the guest list, and if "endDate = today", I'll send them a message as a reminder
I tried this in so many ways but I cant achieve it. Problems I'm facing are the response from the API is every key-value pair in the list (it would be fine if every guest were in a separate object). Also, if I turn off simple response, I just can't by any means iterate thru the array to send them a message
So, summarizing, in my workflow, for the API request for every "Data [N] endDate" ([N] being the index for each guest) I need to check if the date equals to the current day. If so, send every single people a message.
How can I achieve that? Thanks!
Hello @drpx,
I’ve made a few updates to your workflow and recorded a short video explaining how you can achieve your use case. You can check it out here: https://www.loom.com/share/8b480b5656a34b1e8025a7c31a5f98b4?sid=e4a4f8d9-d79a-4555-a4db-d25b19f0e219.
Hello @drpx,I’ve made a few updates to your workflow and recorded a short video explaining how you can achieve your use case. You can check it out here: https://www.loom.com/share/8b480b5656a34b1e8025a7c31a5f98b4?sid=e4a4f8d9-d79a-4555-a4db-d25b19f0e219.
Thanks, it worked! ?
Hello @drpx,
Thanks for the update, we'd love to hear your thoughts! If you have a moment, please rate us on Google. Your feedback helps us improve.