Add field from related table to form

223
1
02-05-2023 02:35 PM
CourtneyWatson
New Contributor III

I have a Tree point layer and a related non-spatial table containing inspection fields.  Is it possible to include the fields from both the Tree and the table in the same form?  Currently I am completing the form for the trees, then I select the related table and complete another form so it's a 2 step process.

The data is constantly being updated so a join wont help me I don't think.  Any help would be really appreciated.

Using 10.9 Enterprise feature service layers.

0 Kudos
1 Reply
NoahWasserman
New Contributor III

You can add fields that are hidden and not editable in your Inspections table that pull data based on your join ID from your Trees layer.  Then access those in your form.  For example here's a way to grab one bit of data...(I'm sure there are easier ways to do this, but this is what I've been using)...

var related = FeatureSetByRelationshipName($feature, "Trees", ["height"], false);
var feature = First(related);
if(feature == null) {
return null
}
return feature.height

 

This post might be helpful

0 Kudos