Select to view content in your preferred language

arcade expression in Field Maps pop-ups

1259
10
Jump to solution
01-07-2026 09:55 AM
SarahRijneke
Frequent Contributor

Hello, 

I would like to create a simple arcade expression for a point layer (with a join) in map viewer (portal). The pop-up currently links to Survey123 and shows a photo attachment. I would like to also display some text, but only for a specific point. My expression runs in the New Expression editor but when I click on the point in the map, the text does not appear. I also get an error (Error code: 7018) in the field maps app. The field I am referencing is a text field and my expression is as follows:

if ($feature.stop_id == '00627'){
	return "pile to the East"}
	else {return ""}

 

0 Kudos
1 Solution

Accepted Solutions
SarahRijneke
Frequent Contributor
10 Replies
JasminePrater
Frequent Contributor

Error code: 7018 is a syntax error.  I'm no expert, but try something like the following:

if (feature.stop_id == '00627') {

   return "pile to the East";

} else {

   return "";

}

0 Kudos
DavidSolari
MVP Regular Contributor

Your expression runs fine in the Arcade Playground so I doubt it's the issue. Maybe some parts of ArcGIS handle nonstandard formatting weird, you can sub in this 1-line version to test that:

Iif(f.stop_id == "00627", "pile to the East", "")

Does the pop-up work in the regular map viewer or is it broken everywhere? Some pictures of how you've configured the pop-up will help here.

0 Kudos
SarahRijneke
Frequent Contributor

The code you provided doesn't work in the expression builder:

SarahRijneke_4-1767815642491.png

 

0 Kudos
DavidSolari
MVP Regular Contributor

Ah sorry, I forgot to sub out my playground test variable, replace f with $feature in your case.

0 Kudos
SarahRijneke
Frequent Contributor

The arcade expression is stored in the pop-ups pane with the expression I mentioned above. 

When I click on the point where the text should appear, nothing shows.

This is what it looks like in the field maps app 

 

This is the error message: 

Expression name:

Expression title: Note

Error domain: com.arcgismaps.exceptions.MappingException

Error code: 7018

Error description: Arcade expression is invalid. Expression doesn't return a dictionary.

SarahRijneke_3-1767815467091.png

SarahRijneke_0-1767815071018.png

RhettZufelt
MVP Notable Contributor

You mention a 'join' and 'portal', but didn't mention the version.  Is this a hosted layer or Enterprise?

I ask, as there is a bug in FMA ( BUG-000163548 - The ArcGIS Field Maps field app does not display pop-ups for a feature layer with a joined table from ArcGIS Enterprise 10.8.x.).
I am using 10.9.1 and this is still an issue.  The popup(s) work fine in map viewer (both of them), but is just ignored in FMA.
In your case, I'm wondering if only the Arcade is coming up in the popup, but not the actual data?
You could test to see if it is this issue by using the same layer in a map with no arcade, and see if the popup works in FMA or not.  If it comes up, something else.....

R_

0 Kudos
SarahRijneke
Frequent Contributor

I believe we're using Enterprise 11.3 and that it's a hosted service (I didn't create the dataset). 

The pop-up in map viewer doesn't display the expression and I get the 7018 error in field maps when I click on any point. The other pop-up configurations show in Field Maps (a link to launch a survey & a photo attachment).

The field length looks bizarre to me but I don't have a lot of experience working with portal items so I don't know if it's unusual or not. 

SarahRijneke_0-1767817614111.png

 

0 Kudos
DavidSolari
MVP Regular Contributor

That's the max field length in most databases (largest singed 32-bit integer) it usually means your field was designed to hold big blocks of text. In your case it looks like the data design process went sideways but if you can read the field as-is in the rest of ArcGIS then the length probably isn't the issue.

SarahRijneke
Frequent Contributor

the AI assistant came up with the following code which works in the map, but not in field maps.

IIf(
  $feature.stop_id == "00627",
  "Pile snow to the East behind the hydro Pole. DO NOT PILE ON LAWN.",
  ""
);

SarahRijneke_0-1767878901015.pngSarahRijneke_1-1767879226224.png

 

0 Kudos