Calculate Length to a Field in the Form

411
7
Jump to solution
03-26-2024 11:31 AM
kapalczynski
Occasional Contributor III

When I go into field maps and draw a new line feature I can see that its calculating its length in ft every time I add a node... 

Is there anyway to take this value and write it to an an attribute field on SAVE

 

0 Kudos
1 Solution

Accepted Solutions
kapalczynski
Occasional Contributor III

Appears that this 'Calculated Expressions' are not available till 11.0 and later... we are not there yet... sadly we are still at 10.8.1

kapalczynski_1-1711554897165.png

 

 

 

View solution in original post

0 Kudos
7 Replies
JakeBrownMaps
Esri Contributor

Hello @kapalczynski  - are you using a form for data collection?  You could add a field for length and use an arcade calculated expression:

Round(LengthGeodetic($feature,'feet'),2 )
 
 
 
 
 
Hope that helps-
 
Jake Brown - Product Engineer - Esri Apps Team
0 Kudos
kapalczynski
Occasional Contributor III

I have a Feature Class that I published from my Oracle Server.  

This is a non hosted Feature Layer in my Portal

I added this Feature to a Web Map and then consume the Web Map in Field Maps.  

Can I do that with the above workflow or do I need to create a new FORM in Field Maps and point it to the Dataset... Not sure how to do this as I have always just consumed the Web Map in Field Maps

 

 

0 Kudos
kapalczynski
Occasional Contributor III

If I create a new form does this overwrite the one that I am using from the Web Map?  And then I can add the arcade expression in the new form?

kapalczynski_0-1711482766120.png

 

 

0 Kudos
kapalczynski
Occasional Contributor III

I added a new field but not sure where to put the arcade expression?  Thoughts?

I can add an expression in the web map and it shows me the length... but not sure how to get this to write to the new field I created .... especially when I am in Field Maps adding a new feature

0 Kudos
JakeBrownMaps
Esri Contributor

Hey @kapalczynski -- where the data is hosted shouldn't matter - the Arcade is running client side. 

There have been some changes to the Arcade Editor and Form layout - so I included a screenshot of from an 11.1 enterprise instance below (data referenced from SQL Server).  If you click on the field in the form first, you should see the property panel on the right show all the detail for your number/text field.  On the bottom right - look for Calculated Expression and add your arcade there. 

Currently Field Maps is limited to Arcade v1.19 (as it's tied to Runtime 100).  Your version of portal may also impact what version of Arcade you're able to utilize.  See matrix guide below.

https://developers.arcgis.com/arcade/guide/version-matrix/

 

Arcade_11_1.png

 

Let me know if you have any more questions- 

-Jake

0 Kudos
kapalczynski
Occasional Contributor III

@JakeBrownMaps 

Thanks for your input and help... I go into Field Maps editor and then to the webmap and to the Form section and I dont see anything you are seeing.... 

Note that once I get to the FORM section there is nothing there... I drag the new field into the form and then this is what I see. I do not see anything regarding Calculated Expressions only conditional Visibility.

kapalczynski_0-1711544892890.png

 

0 Kudos
kapalczynski
Occasional Contributor III

Appears that this 'Calculated Expressions' are not available till 11.0 and later... we are not there yet... sadly we are still at 10.8.1

kapalczynski_1-1711554897165.png

 

 

 

0 Kudos