One of the issues with automated emailing using Power Automate and When a Record is Updated trigger is that there is no way to filter the field that is being changed. This is problematic when trying to create a host of automated emails relating to a single feature layer to notify users when certain changes are happening.
What would be really useful is the ability to use a logical function to select the field that is being changed to then feed into the action. For example, Send email IF field/ProjectManager is updated, rather than Send email when Feature Layer is updated, since not all fields that are updated require automated email notifications.
I 100% agree with this that this is much needed functionality. I have a Power Automate flow that sends out up to four emails at a time based on four fields and because the trigger recognizes all changes, I had to find a very complex workaround using dates in the field and date time of edit to accomplish this, which is not foolproof.
Did you have any luck with that workaround? I ask because, I actually ran into a couple issues with the date time condition and I'm curious if it worked for you. There were two issues, firstly:
1. The date field may never match with utcNow (unless you make it just date and not time, in which any edit that same day will probably trigger the email again).
2. Date and time condition has an issue because the ArcGIS feature layer trigger can take up to 5-6 minutes to trigger. In my flow I set a condition for a 6 minute buffer window so that emails are only sent out within that window, and if the date field is over a 6 minute difference from the time the trigger ran, then no emails are sent.
Yes, initial testing today and shown it to work. I'm working off a feature layer with over 250 fields and around 300 rows. Sometimes the flows can break if there is too much data for the trigger to filter, so many be worth, if you have a large amount of data, to filter down using the 'Get data from feature layer" action, and using the available fields and where function.
In order for the date and time function to work, there are a few things that need to happen.
1. You need 3 loops after the trigger. The first being to fetch updates, changes etc from the 'When record is updated' trigger.
2. A loop immediately after the fetch updates which will be used to convert the date and time field, since Power Automate can't read feature layer fields as date and time. Then within that loop, you need to convert the time into date only using compose. The function loops like this:
Very informative, thank you!! I like how you mentioned the get data action since that could have streamlined the flow a bit more.
So that I'm understanding - the biggest limitation of the workaround you found is that once the date is set to today's date and the flow is run & email is sent, etc. that record should not be edited again in that same day, correct? If it's edited again, then the email will send out again redundantly?
You're welcome.
Yes, that's correct. Although I wouldn't say that would be an issue, since it would allow users to be made aware of changes on an Adhoc basis. What you could do instead is use the standard utcNow() and date field, without converting them to date only, and using that in the condition. Then users would be able to change the attribute without an email being sent, if the date field associated with the change field isn't updated.
Thanks @JustPete! In our use case, our email notifications only play a role when the process reaches a certain few checkpoints - sending automated notifications to leadership. As a result, it was really important for us to ensure that emails were only sent when necessary, so again pointing back to your idea being very important on only returning change fields!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.