I have a recipe that triggers off of updated events in Google Calendar. In the recipe, I want to record a history of the RSVP status of event guests. Every time the event is modified, I want to record the time, name, and response status of the event guests in the Event description.
The issue here is that using the Update Event action in my recipe to record the response history triggers my recipe to run again which puts the recipe into a recursive loop.
Usually when I have a recipe that is triggered by an update, I add a filter to the trigger to not process records that have some condition which I can set in my Update action later on. In this case however, I want the recipe to continue checking for future event updates and RSVP responses so that strategy won't work.
Any ideas?
Best Answer
B
Bryan Yap
said
almost 7 years ago
Hi Brad, here's a suggestion. You can try having a recipe that is triggered whenever an event on Google Calendar is modified. Then, based on the details of the event, i.e. the Event name, invitees, last modified datetime, the recipe will concatenate these values into a string and computer a hash value using our SHA256 function in formula mode.
Next, the recipe will go ahead and search a google sheet/csv file for this hash value to check if we have seen it before. If we have not, the recipe will go ahead and update the google sheet or csv file with this new hash and proceed to append the relevant details into the description of the calendar event.
You might need to refine this idea a little but in theory it would work because the hash values will only match up if and only if the previous event and the new event are exactly the same.
Answer
Bryan Yap
said
almost 7 years ago
Hi Brad, here's a suggestion. You can try having a recipe that is triggered whenever an event on Google Calendar is modified. Then, based on the details of the event, i.e. the Event name, invitees, last modified datetime, the recipe will concatenate these values into a string and computer a hash value using our SHA256 function in formula mode.
Next, the recipe will go ahead and search a google sheet/csv file for this hash value to check if we have seen it before. If we have not, the recipe will go ahead and update the google sheet or csv file with this new hash and proceed to append the relevant details into the description of the calendar event.
You might need to refine this idea a little but in theory it would work because the hash values will only match up if and only if the previous event and the new event are exactly the same.
B
Brad Eisenberg
said
almost 7 years ago
Fantastic idea Bryan! I actually ended up implementing another strategy - I had my recipe add a time stamp to the last row of the event description when making automated updates from the recipe, and also added a condition to my trigger to parse the description of newly modified events and disregard those with a time stamp within the last minute.
It's an imperfect solution, as it eliminates events that have been validly edited by users within that time window, but it's done the trick so far.
As I continue to tinker, I'll consider you hash strategy as an alternative. My only concern with your idea in my case is the sheer number of events the recipe is processing. A reference spreadsheet could become unwieldy.
Bryan Yap
said
almost 7 years ago
Hi Brad,
Agreed, if you are intending to have numerous events being processed by the recipe, then I would recommend that you consider making use of a production grade database such as SQL Server using our SQL Server connector. Google sheets and CSVs are only a good fit for cases where the recipe load is low. Alternatively, if you are open to trying, I believe you can also try writing the data to other databases such as firebase/firestore. But in that case, you would need to make use of our HTTP connector to do CRUD operations.
R
Rachel Natik
said
over 2 years ago
I know this is an old post, but adding my thoughts here for anyone who comes across this thread.
I had a recipe triggered when a record is modified in Salesforce. The Recipe also updated the initial record causing us to end up in a recursive loop. To prevent this, I did the following:
1. Created a datetime field in Salesforce. In the step where Workato updates the Salesforce record, we populate this field with "now + 1.minutes". I added a minute to account for second differences instead of handling it via formulas in Salesforce.
2. Created a formula checkbox field in Salesforce which returns TRUE if the Workato Timestamp is greater than the LastModifiedDate. This tells us that the last edit to the record was through Workato and the record should be ignored until it is actually modified by a user. I needed to create this formula field since SOQL does not allow you to compare 2 fields.
3. Added a filter to the Recipe, only selecting records where the above checkbox was FALSE.
Brad Eisenberg
Looking for strategy to prevent a recursive loop
I have a recipe that triggers off of updated events in Google Calendar. In the recipe, I want to record a history of the RSVP status of event guests. Every time the event is modified, I want to record the time, name, and response status of the event guests in the Event description.
The issue here is that using the Update Event action in my recipe to record the response history triggers my recipe to run again which puts the recipe into a recursive loop.
Usually when I have a recipe that is triggered by an update, I add a filter to the trigger to not process records that have some condition which I can set in my Update action later on. In this case however, I want the recipe to continue checking for future event updates and RSVP responses so that strategy won't work.
Any ideas?
Hi Brad, here's a suggestion. You can try having a recipe that is triggered whenever an event on Google Calendar is modified. Then, based on the details of the event, i.e. the Event name, invitees, last modified datetime, the recipe will concatenate these values into a string and computer a hash value using our SHA256 function in formula mode.
Next, the recipe will go ahead and search a google sheet/csv file for this hash value to check if we have seen it before. If we have not, the recipe will go ahead and update the google sheet or csv file with this new hash and proceed to append the relevant details into the description of the calendar event.
You might need to refine this idea a little but in theory it would work because the hash values will only match up if and only if the previous event and the new event are exactly the same.
Bryan Yap
Hi Brad, here's a suggestion. You can try having a recipe that is triggered whenever an event on Google Calendar is modified. Then, based on the details of the event, i.e. the Event name, invitees, last modified datetime, the recipe will concatenate these values into a string and computer a hash value using our SHA256 function in formula mode.
Next, the recipe will go ahead and search a google sheet/csv file for this hash value to check if we have seen it before. If we have not, the recipe will go ahead and update the google sheet or csv file with this new hash and proceed to append the relevant details into the description of the calendar event.
You might need to refine this idea a little but in theory it would work because the hash values will only match up if and only if the previous event and the new event are exactly the same.
Brad Eisenberg
Fantastic idea Bryan! I actually ended up implementing another strategy - I had my recipe add a time stamp to the last row of the event description when making automated updates from the recipe, and also added a condition to my trigger to parse the description of newly modified events and disregard those with a time stamp within the last minute.
It's an imperfect solution, as it eliminates events that have been validly edited by users within that time window, but it's done the trick so far.
As I continue to tinker, I'll consider you hash strategy as an alternative. My only concern with your idea in my case is the sheer number of events the recipe is processing. A reference spreadsheet could become unwieldy.
Bryan Yap
Hi Brad,
Agreed, if you are intending to have numerous events being processed by the recipe, then I would recommend that you consider making use of a production grade database such as SQL Server using our SQL Server connector. Google sheets and CSVs are only a good fit for cases where the recipe load is low. Alternatively, if you are open to trying, I believe you can also try writing the data to other databases such as firebase/firestore. But in that case, you would need to make use of our HTTP connector to do CRUD operations.
Rachel Natik
I know this is an old post, but adding my thoughts here for anyone who comes across this thread.
I had a recipe triggered when a record is modified in Salesforce. The Recipe also updated the initial record causing us to end up in a recursive loop. To prevent this, I did the following:
1. Created a datetime field in Salesforce. In the step where Workato updates the Salesforce record, we populate this field with "now + 1.minutes". I added a minute to account for second differences instead of handling it via formulas in Salesforce.
2. Created a formula checkbox field in Salesforce which returns TRUE if the Workato Timestamp is greater than the LastModifiedDate. This tells us that the last edit to the record was through Workato and the record should be ignored until it is actually modified by a user. I needed to create this formula field since SOQL does not allow you to compare 2 fields.
3. Added a filter to the Recipe, only selecting records where the above checkbox was FALSE.