Field Maps Arcade Expressions

7828
16
Jump to solution
12-10-2020 09:17 AM
BClaridge
New Contributor II

Hi There, I'm new to Field Maps and Arcade expressions.  I have done some research and believe I should be able to write an expression to auto populate a field based on the user entry into another field.  For example, if the user is collecting a point or line in a particular area which is in a field office- I should be able to auto populate the field office field with the name using some sort of select by location expression.  

I could use some help with getting started on the expression...

Something like:

//if point is located in X, then Y. The Field office feature is another hosted layer in the webmap. The field I want to populate is the $feature["ADMIN_ST"] and it has domains...

BClaridge_0-1607620606650.png

 

1 Solution

Accepted Solutions
by Anonymous User
Not applicable

@Dan_Joyce_OE 

the popup doesn't display it in Field Maps and only shows the default fields.

Are you configuring the expression and pop-up in the newer Map Viewer? Field Maps doesn't fully support the pop-ups authored by the new Map Viewer (this is under development and planned for this fall). Can you try configuring the pop-up in Map Viewer Classic?

View solution in original post

0 Kudos
16 Replies
JeffShaner
Esri Regular Contributor

Welcome @BClaridge  and thank you for your post. Unfortunately this capability is not available yet. With the current support for Arcade expressions in Field Maps, we use the constraint profile and evaluate an expression for the purpose of displaying/not displaying fields. Use of the field calculate profile is on our roadmap and is perhaps the most important smart form feature for us to complete in 2021. 

Please let us know what types of calculate expressions you are looking to accomplish. We are looking for examples to help us drive priority of requirements. Thanks!

ScottLehto3
Occasional Contributor

Hi Jeff,

       Thank you for that information. Is there a likely timetable for calculating fields in Field Apps?

 

       I am looking to do some real basic calculations. Such as:

 

On a Save Event or Attribute Change Event:

if(id > 0)

{

return 1;

}

else

{

return 2;

}

 

and calculates such as:

 

if (point_type =='Tree' && species== null)

{

species = 'unknown'

}

Thanks Again,

Scott

KaraUtter
Occasional Contributor III

Hello Jeff, how is this update going? I thought it was available already based on information found on THIS PAGE, but I cannot get any values to pass into the entry fields in the form based on arcade expressions, so it must only be for showing pop-ups in field maps? The need to pass values into the etnry fields in the form appears to be an in-demand function for a variety of purposes:

How to pass attributes from selected feature into ... - Esri Community

Run Arcade on events - Esri Community

Copy Value from another Layer when creating a new ... - Esri Community

I created the following expression to pass values from an intersecting layer into a newly created point feature in Field Maps, and though it works in pop-ups for already created points, I cannot see a path for me to connect the expression to the field in the Field Maps form to become a permanent attribute value in the dataset:

var intersectLayer =Intersects(FeatureSetByName($map,"Parcels"), $feature)
for (var f in intersectLayer){
return f.legalac+" Acres; "+f.subdivname+" "+f.LEGAL1+" "+F.LEGAL2+" "+F.LEGAL3
}

@ShaneClarke

MichaelWallace3
New Contributor III

I have a similar expression and didn't know about this bug. Had to delete it so primary operation with Field Maps (linking to survey123) worked properly. I suspect this might be tricky to implement because your querying a layer that may or may not be offline.

0 Kudos
QuantitativeFuturist
Occasional Contributor

When will this be available? Calculate functionality of fields based on the values of other fields is needed. Thanks

CodraFrum1
New Contributor II

Hi Jeff,

Is there a problem with the new version (22.2) of Field Maps that not allow pop-ups using ARCADE expressions? Last version of Field Maps knew to display ARCADE expressions

Thank you for your attention,
Codra

 

JeffShaner
Esri Regular Contributor

Hi @CodraFrum1 - we are not aware of any issues viewing Arcade expressions in pop-ups with the latest version of Field Maps over previous. 

Can you please reach out to Esri Support and log an incident? They will walk you through troubleshooting the expression and provide us with a repro case we can dig into..

Thanks!

Jeff

0 Kudos
CodraFrum1
New Contributor II

Hi Jeff,

Can I require (a must field) capturing a photo in Field Maps, as I can in Survey123? 

Thank you in advance,

Codra

0 Kudos
JustinReynolds
Occasional Contributor III

I don't believe that is possible yet.  I think this will appear once inline attachments are supported in field maps, then you could tie a required expression to the formAttachmentElement.  I've recently inquired about inline attachments from the field maps team.  Their feedback is that it is in the product plan, it is currently supported in the new map viewer spec, but the field maps portion looks to be on a 2023 timeline.

- Justin Reynolds, PE
0 Kudos