Arcade Code for popup

282
1
Jump to solution
08-05-2022 08:31 AM
anonymous55
Occasional Contributor II

Hello

I have this code which bring different fields from another layer to pop up but I can't get the result on popup

var fips = $feature["parent_id"]

var dd = FeatureSetByName($map,
"Survey v2", ['age','gender','race'],False)

var fillterSur = "survey_id = @fips"

var cou = First(Filter(dd, fillterSur))

var popupTEXT = "Age: "
+Text(cou,'#,###')
var popupTEXT = "gender: "
+Text(cou,'#,###')
var popupTEXT = "race: "
+Text(cou,'#,###')

return popupTEXT

 

The result I am getting is like this :

anonymous_0-1659713413690.png

 

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

You have to provide the appropriate field to show for each statement.

 

var popupTEXT = "Age: " + cou.age; //you don't need to use Text formatting in this line since the value would be "25 - 34"
var popupTEXT = "gender: " + cou.gender;
var popupTEXT = "race: " + cou.race;

 

If  you want all three values in the same popup, this is one way of doing so

 

var popupTEXT = "Age: " + cou.age + TextFormatting.NewLine + 
                "gender: " + cou.gender + TextFormatting.NewLine + 
                "race: " + cou.race;

 

View solution in original post

1 Reply
KenBuja
MVP Esteemed Contributor

You have to provide the appropriate field to show for each statement.

 

var popupTEXT = "Age: " + cou.age; //you don't need to use Text formatting in this line since the value would be "25 - 34"
var popupTEXT = "gender: " + cou.gender;
var popupTEXT = "race: " + cou.race;

 

If  you want all three values in the same popup, this is one way of doing so

 

var popupTEXT = "Age: " + cou.age + TextFormatting.NewLine + 
                "gender: " + cou.gender + TextFormatting.NewLine + 
                "race: " + cou.race;