Select to view content in your preferred language

Update feature layer with most recent related record

617
5
12-14-2022 05:28 AM
erica_poisson
Regular Contributor

Hi - 

I am building a new Flow to update a feature layer based on the updates to a related table. The data is updated through Survey123, so I am using the Survey123 trigger in conjunction with the new ArcGIS Connector to "Update a record in a feature layer".

I've set my condition so that the update only occurs when Update Type = Status Change, however I can not figure out how to only look at the most recently submitted related record. While this Flow is working well and my feature layer is being properly updated, I can't help but think there is a better way to do this... I just don't know what that way is. 

What I'd like to do is have the Flow only look at the most recently submitted related record via the Survey123 trigger. What is actually happening is that every related record is being assessed and the feature layer is being updated multiple times. 

Any suggestions would be helpful. Below is my current configuration:

erica_tefft_0-1671024457042.png

 

Erica
0 Kudos
5 Replies
SeanKMcGinnis
Esri Contributor

Hi @erica_poisson 

I have two thoughts on this:

  1. For the related table, is the 'DCR File Number' field the unique identifier or is it the key that joins the spatial feature with the related table?
  2. You might have to query the related table by the DCR File Number, then inspect the dates for all of the related records to get the one with the most recent date in order to get the unique id for the most recent record.

Please let me know if you have any questions on that.

-sean
Sean McGinnis - ArcGIS for Microsoft 365 Product Manager
0 Kudos
erica_poisson
Regular Contributor

Hi @SeanKMcGinnis -

Thank you for the quick reply...

1. DCR File Number is one of the unique identifiers, however the relationship is based on a GlobalID/GUID relationship class. 

2. So, would I modify my Flow so that I first have the ArcGIS Connector "Get data from feature layer", right after the Survey123 trigger? Is there where I could use the Where clause to set up this query? I am not really sure if I understand how to inspect the dates for all related records within the context of these new connectors. If you have additional steps/details or even a sample Flow or workflow I could look at, that would be massively helpful.

Thank you,

Erica
0 Kudos
icf_Eric_Link
New Contributor III

Hi Erica,

 

I'm looking to do the same thing.  Did you ever get this figured out?

0 Kudos
erica_poisson
Regular Contributor

I did not ever get this figured out. Each time my flow is triggered, it runs through all related records for the parent record.

Erica
0 Kudos
icf_Eric_Link
New Contributor III

Okay thank you.

0 Kudos