AutoFill Data using a Relationship Class

1547
6
Jump to solution
10-11-2021 03:57 AM
by Anonymous User
Not applicable

I have a related layer and table, related to each other using a unique identifier. The one to many relationship class was made in arcgis pro and published online.

The first layer is a list of features, with geographic data, and the table is a list of inspections that takes place on different features in the first layer from time to time. My problem is that I want some of the fields in the child table (such as the name, highlighted yellow in the image) to automatically update based on the parent layer. So when a field worker selects H001 on the map, then the hydrant name should get automatically updated based on whats in the parent table?

VenugopalAgrawalSaath_0-1633949679806.png

Is it possible to do this, either using an inbuilt function or using a script? I would really appreciate any help on this, since this will simplify our workflows considerably.

 

1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

If you want it to autopopulate offline in the field then no I know of no way to do that.  Attribute Rules may do it but they will not be around for 6 months or more.

If you are on a field device then a Field Maps/123 combo can simulate it.  What I do it pass whatever data I need from the parent in Field Maps to the child which is a 123 form.  Or you can just use 123 and use pulldata to fill it out.  You could also use a callback URL to pass from 123 back to Field Maps.

Old school option is to run a script each night to copy the field.

I also wonder why not use domains and have the H0001 link to the friendly name. 

I would still look at ways to grab it without dual data.  Having data in two places always becomes a pain.  Like what if the name of H0001 gets changed?  Do you go back and recalc all of those?  Related tables lets you change the name in one place and they all get the update.

Not sure I understand your workflow enough.

Hope that helps

View solution in original post

6 Replies
DougBrowning
MVP Esteemed Contributor

What do you want it in the other table for?  Just to display?  If so you can use FeatureSet in Arcade to do this.  That way if the data in the related changes you do not have to worry about updating it all.

Here is an example using an id.  Note you can also do lookups by relationship class.  I use this a lot so that users do not have to go look in the child.

var sql = "PlotID = '" + $feature.PlotID + "'";
var tbl = Filter(FeatureSetByName($map,"Plots", ['*'], false), sql);
return First(tbl).AdminState

Hope that helps

by Anonymous User
Not applicable

@DougBrowningThanks a lot for taking the time to reply.

I don't want this just for display, I need the field in the table to get populated as well. While I am new to arcade, my understanding is that for the display, I would use such an arcade expression while configuring the popup. But rather than that, our requirement is that the field should get updated on the table, so that the updates also reflect in other services which are linked to the feature layer using integromat and scripts.

So i guess the question is, how do we use a script to auto populate a field using a related table, when someone is collecting data on the field?

Please let me know if you think this is possible. Thanks a lot for your help.

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

If you want it to autopopulate offline in the field then no I know of no way to do that.  Attribute Rules may do it but they will not be around for 6 months or more.

If you are on a field device then a Field Maps/123 combo can simulate it.  What I do it pass whatever data I need from the parent in Field Maps to the child which is a 123 form.  Or you can just use 123 and use pulldata to fill it out.  You could also use a callback URL to pass from 123 back to Field Maps.

Old school option is to run a script each night to copy the field.

I also wonder why not use domains and have the H0001 link to the friendly name. 

I would still look at ways to grab it without dual data.  Having data in two places always becomes a pain.  Like what if the name of H0001 gets changed?  Do you go back and recalc all of those?  Related tables lets you change the name in one place and they all get the update.

Not sure I understand your workflow enough.

Hope that helps

by Anonymous User
Not applicable

@DougBrowningThanks for the reply.

That's an interesting point, that it is better to maintain data in only 1 place. Our challenge is that the data collected by our field workers needs to be shared with various partners, using more traditional formats like excel. So we were trying to create a system where we wouldnt have to create joined tables every time we had to submit data. I agree, even in other threads, it does not seem to be possible right now. Really need attribute rules to be able to do this well.

Thank you for replying. Clearly for now it seems that there is no way to do this.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Have you looked into Hosted Feature Views?  I think they can show a joined table now for export.

https://doc.arcgis.com/en/arcgis-online/manage-data/create-hosted-views.htm 

0 Kudos
skunkpup
New Contributor

Thank you. This link is so helpful.

redactle

0 Kudos