Select to view content in your preferred language

Common calculated expressions for ArcGIS Field Maps

2008
6
05-12-2022 05:01 AM
by Anonymous User
Not applicable
3 6 2,008

Calculated expressions in ArcGIS Field Maps streamline all kinds of data collection workflows from storing location as an attribute, to pulling attributes from related records or other layers in the map.

Check out this blog post, where we walk through some of the most common use cases and provide sample code to get you up and running with calculated expressions in your own forms.

6 Comments
FrankMartin1
Regular Contributor

Are these calculated expressions available in Enterprise 10.9.1? If not, is there a timeline for updating Enterprise to include this functionality?

Thanks,
Frank

by Anonymous User
Not applicable

The authoring UI for calculation expressions will be available in Enterprise 11.0 which is scheduled to be available in July.

FrankMartin1
Regular Contributor

@Anonymous User ,

Thanks for the update.  I'm looking forward to using this functionality in our Enterprise applications.   Wish it was sooner.   🙂

FrankMartin1
Regular Contributor

@Anonymous User ,

I have question with regard to fetching an attribute from a related record using the FeatureSetByRelationshipName.  I'm not sure where to to find the relationshipName.   In Arcade, there is a "Related Records" chevron for the $feature that shows the folowing:  FeatureSetByRelationshipName($feature,"gisedit.GIS.parks_tree_inventory").  This relationship (feature, table) was created in an SDE enterprise geodatabase, published to an ArcGIS Server, and the added to AGOL as a feature layer.   The line within the Arcade expression, FeatureSetByRelationshipName($feature,"wgisedit.GIS.parks_tree_inventory",['Location'], false);, does not fail, but in the field maps application there is an error "Failed to evaluate".

Is this the correct relationshipName?   Does the function work with this type of relationship?

Thanks,

Frank

 

 

 

by Anonymous User
Not applicable

@FrankMartin1  If you go to the feature layer rest endpoint and view the JSON of it, you should see something called relationships like this:

AaronPulver_0-1653676676147.png

You should be using that "name" property. I suspect what you have is correct. Would you be able to share your map and layers with me via DM? We can take a look at it.

Katelyn_Corrigall-Millins
Occasional Explorer

@Anonymous User I have been looking at the related records code for a few days now trying to get it to pull logs from the child table to the parent layer.

By using the code from the aforementioned article I was unable to populate anything in ArcGIS Field Maps, it "fails to calculate" and the error in field maps shows as "Invalid relationship name". By switching to FeatureSetByName, I am able to populate records but it only pulls the first record OBJECTID finds in the logs rather than the related ID, which means I would have to use Filter and GroupBy of which I am also struggling to have a Child to Parent relationship. Does FeatureSetByRelationshipName not allow a Child to Parent relationship? Is this why the code fails? I am more than willing to share my code and layers if needed.