I am using the "When an event is added, updated or deleted (V3)" trigger to send an email notification for events that live on a shared calendar. This flow also automatically accepts the event for the calendar account when it is added (based on the ActionType condition).
This is working great to send an email on any new, removed, or changed event, however it is triggering when the event is added and then immediately again when the event is accepted (which fires as an "updated" trigger). How can I differentiate this acceptance update and exclude it from the flow so that the email is only sent once on event creation?
Is there some variable that represents what is actually changed about the calendar item?
Thanks,
Greg
Solved! Go to Solution.
Hi gregkegel,
If we want to differentiate this acceptance update and exclude it, we should know what's the differences of the reponse in flow.
1. Get the body context when the event was created and updated
2. Compare the text, we found the responseType in the output is different
3. Add a condition after the trigger. If you only send once on event creation, you can set a condition like below.
On event creation, you can add sent email action under 'If Yes'. If the event is updating, the flow skip the ations in 'If Yes' and follow the actiona in 'If no'.
Hi gregkegel,
If we want to differentiate this acceptance update and exclude it, we should know what's the differences of the reponse in flow.
1. Get the body context when the event was created and updated
2. Compare the text, we found the responseType in the output is different
3. Add a condition after the trigger. If you only send once on event creation, you can set a condition like below.
On event creation, you can add sent email action under 'If Yes'. If the event is updating, the flow skip the ations in 'If Yes' and follow the actiona in 'If no'.
Thank you for your reply!
I tried this initially, but this "responseType" seems to be static after the event is accepted, meaning any future "updates" to the event will still report the responseType as "accepted". How do I differentiate between an event that is just being updated versus an event that is updated *because* it was accepted?
Ultimately, I worked around this one by comparing the response time to the modified time. If these were the same (or within a second away from eachother), it can be determined that the "update" is actually the response.
@gregkegel I just found your post which was very helpful for me. Can you show me how you compared the response time to the modified time? Thanks a lot!
Hi @CaSi
Not sure if it's the best way, but first I establish some time variables:
I check if Last modified on the event is not null:
if not, then I set variable "timeModified" to:
Thanks a lot @gregkegel. This has brought me further. The setting of variables as integers output an error (I think it needs to be string) so I changed the flow a little bit and now it works for me. This is my flow:
For the "When an event is added, updated or deleted (V3)" I set the Trigger Conditions under Settings to
@equals(triggerOutputs()?['body/responseType'], 'accepted')
followed by Convert Time Zone for Response Time and Last Modified Time.
After that I used an Expression in Compose with
User | Count |
---|---|
87 | |
43 | |
21 | |
18 | |
15 |
User | Count |
---|---|
130 | |
47 | |
42 | |
35 | |
28 |