Select to view content in your preferred language

Action Based on Specific Changes in a Feature Layer

139
3
3 weeks ago
RobertAnderson3
MVP Regular Contributor

I am working on a Power Automate trigger for a tree planting program, the goal is to have a watering task created when a tree planting task is marked as "COMPLETE"

I have this workflow going using the When a feature layer is updated trigger and then the Fetch Updates action, but the issue I am running into is that if for some reason the completed task is edited AFTER the status is set to COMPLETE, it then triggers again and creates a duplicate watering task because the condition is looking for the COMPLETE from the updated features.

Is there a way to filter down to a specific change in the feature layer? So it will only trigger the create water task if the change to the feature is specifically the status being switched to COMPLETE?

0 Kudos
3 Replies
Tiff
by
Occasional Contributor III

I am following this post because it is a VERY good question. It is so important to be able to pinpoint specific changes to the feature layer. I am curious if Esri or others have any knowledge on doing this.

I had gone through a similar issue here, but my fields were all date fields. Esri support helped identify a workaround in that we would set a condition where if the date of edit was some time later than the date inputted in the field, then the action would not run. For example, if you have the field Tree Planting Task = Complete, and add an additional Completion Date field, you could achieve that similar workflow! However, it's clunky and not as seamless as it would be if the Power Automate trigger could identify changes to a specific field.

DominicRoberge2
Occasional Contributor III

Hi @RobertAnderson3 

could you add an extra field in your feature layer like PlantingFlag (1 or 0, 0 being the default) then when your Planting task is updated to COMPLETE your flow will trigger your watering task  IF Planting task=COMPLETE AND PlantingFlag=0 . Then at the end of the flow, you update the PlantingFlag to 1. 

That should do it.

RobertAnderson3
MVP Regular Contributor

Both of these are good ideas, I do have dates in there that I could use to compare as well with a editDate >= plantDate type thing. I am just always hesitant relying on dates for things cause they're always such a pain.

I'll have to try implenting one or both of these and see if it solves that problem, thank you both for your suggestions!

I definitely would be interested in knowing more from Esri about the ability to check for specific updates though or if something like this is going to be the best way to prevent duplicates.

0 Kudos