Select to view content in your preferred language

Arcade expression to automatically join records from child to parent tables in a web map

823
2
12-19-2022 02:44 PM
JohnMedema
New Contributor III

Hi,

 

I have a survey123 form that contains a repeat for survey data, within each repeat is a nested repeat that collects 2 sets of GPS x,y coordinates.  So this creates 3 separate items in Portal,  two layers and a stand alone table.  Is there a way to leverage arcade expressions in a web map to join (in my example below) the 

examcoord (parentrowid) the fieldcollect table (uniquerowid)?  I dont want to have to join them manually each time a survey is collected.  

JohnMedema_0-1671489457513.png

I intend on using a dashboard to provide an end-user product that will provide a map and details for each survey.  

 

Lastly, the 1st point layer Dig_List_for_ECDA_TRIMP_Survey captures information for each survey but it is collected outside of all repeats.  Is there a way to join this table information to the other point feature?

 

0 Kudos
2 Replies
JenniferAcunto
Esri Regular Contributor

Join is available in the Web Map Viewer Classic. If you check Create results as hosted feature layer view a view layer will be created that updates the join automatically as data is added to the layer. 

Creating results as a hosted feature layer view allows the data to stay up to date as the source data changes. Hosted feature layer views containing joins will be read-only.

Hosted feature layer views containing joins do not consume credits for analysis and storage.

You can create a hosted feature layer view from the analysis results if all of the following conditions are met:

  • You are the owner of both layers.
  • Both layers are hosted feature layers.
  • You are performing an attribute join.

 

2022-12-20_6-27-42.jpg

 

Join Features

- Jen
DougBrowning
MVP Esteemed Contributor

Check out the FeatureSet functions.  You can call up any layer.

Can use by relationship name 

var tbl = FeatureSetByRelationshipName($feature, "Points", ['CollectPoolTailFines'], false);
return First(tbl).CollectPoolTailFines

Or your own query

var EvaluationID = Concatenate($feature.PointID, "_", text(ToLocal($feature.FieldEvalDate), "Y-MM-DD"))
var sql = "EvaluationID = '" + EvaluationID + "'";
var tbl = Filter(FeatureSetByName($map,"Water Quality and Macroinvertebrates", ['EvaluationID'], false), sql);

I use it a lot and it works great.