Hi! I am extremely new to Arcade expressions and have needed to use a lot of AI to help as my tech support, but still can not seem to get my popups up and running. I was able to fix some field issues and get the expression to run without error, and resolved a problem where the "Done" box was grayed out. Now, the problem is that my pop-up appears blank... My goal is to create a simple display where the asset address is at the top, and then there's a bulleted list of attributes organized by category. Does anyone know what I did wrong here? Thank you in advance!
Sincerely,
a sad GIS user
Here is the expression I tried to use:
var returnType = "text";
var content = "";
// Add basic info
content += $feature.Service_Provider + TextFormatting.NewLine +
$feature.Address + TextFormatting.NewLine +
TextFormatting.NewLine;
// Communities Served (Columns E-I)
content += "Communities Served:" + TextFormatting.NewLine;
if ($feature.Countywide == 1) content += "• Serves Countywide" + TextFormatting.NewLine;
if ($feature.Annapolis == 1) content += "• Serves Annapolis" + TextFormatting.NewLine;
if ($feature.Brooklyn_Park == 1) content += "• Serves Brooklyn Park" + TextFormatting.NewLine;
if ($feature.South_County == 1) content += "• Serves South County" + TextFormatting.NewLine;
if ($feature.Com_Other == 1) content += "• Serves Other Communities" + TextFormatting.NewLine;
content += TextFormatting.NewLine;
// Populations Served (Columns J-M)
content += "Populations Served:" + TextFormatting.NewLine;
if ($feature.Families == 1) content += "• Serves Families" + TextFormatting.NewLine;
if ($feature.Students == 1) content += "• Serves Students" + TextFormatting.NewLine;
if ($feature.Educators == 1) content += "• Serves Educators" + TextFormatting.NewLine;
if ($feature.School_Based_Mental_Health_Staf == 1) content += "• Serves School Based Mental Health Staff" + TextFormatting.NewLine;
content += TextFormatting.NewLine;
// Subpopulations Served (Columns N-S)
content += "Subpopulations Served:" + TextFormatting.NewLine;
if ($feature.Black_African_American_Students == 1) content += "• Serves Black/African American Students" + TextFormatting.NewLine;
if ($feature.Hispanic_Students == 1) content += "• Serves Hispanic Students" + TextFormatting.NewLine;
if ($feature.FARMS_Students == 1) content += "• Serves FARMS Students" + TextFormatting.NewLine;
if ($feature.ELL_Students == 1) content += "• Serves ELL Students" + TextFormatting.NewLine;
if ($feature.Special_Ed__Students == 1) content += "• Serves Special Ed. Students" + TextFormatting.NewLine;
if ($feature.Cancer_Support == 1) content += "• Provides Cancer Support" + TextFormatting.NewLine;
content += TextFormatting.NewLine;
// Tier (Columns T-V)
content += "Tier:" + TextFormatting.NewLine;
if ($feature.Tier_1 == 1) content += "• Tier 1" + TextFormatting.NewLine;
if ($feature.Tier_2 == 1) content += "• Tier 2" + TextFormatting.NewLine;
if ($feature.Tier_3 == 1) content += "• Tier 3" + TextFormatting.NewLine;
content += TextFormatting.NewLine;
// Local Priorities Addressed (Columns W-AG)
content += "Local Priorities Addressed:" + TextFormatting.NewLine;
if ($feature.School_wide_Preventative_and_Me == 1) content += "• School-wide Preventative and Mental Health Literacy Programming" + TextFormatting.NewLine;
if ($feature.Individual__Group__and_Family_T == 1) content += "• Individual, Group, and Family Therapy" + TextFormatting.NewLine;
if ($feature.Navigation_and_Case_Management_ == 1) content += "• Navigation and Case Management Services" + TextFormatting.NewLine;
if ($feature.Substance_Use_Disorder_Services == 1) content += "• Substance Use Disorder Services" + TextFormatting.NewLine;
if ($feature.Behavioral_Health_Education__Su == 1) content += "• Behavioral Health Education, Support, and Navigation for Families" + TextFormatting.NewLine;
if ($feature.Wraparound_Supports == 1) content += "• Wraparound Supports" + TextFormatting.NewLine;
if ($feature.Support_Groups == 1) content += "• Support Groups" + TextFormatting.NewLine;
if ($feature.Psychiatric_Care_and_Medication == 1) content += "• Psychiatric Care and Medication" + TextFormatting.NewLine;
if ($feature.Chronic_Absenteeism == 1) content += "• Chronic Absenteeism" + TextFormatting.NewLine;
if ($feature.Cultural_Reach == 1) content += "• Cultural Reach" + TextFormatting.NewLine;
if ($feature.Other == 1) content += "• Other" + TextFormatting.NewLine;
return {
value: content
};
FYI you can format code so it's more readable by choosing the "insert/edit code sample" option when you're making a post.
Try getting rid of this at the top of your code:
var returnType = "text";
Then get rid of this at the bottom of your code:
return {
value: content
};
And replace it with this (you've added all your info to the variable called "content," and you want to return it as text):
return {
type : 'text',
text : content
}
This is formatted like the example return statement you get when you create an Arcade content block, which possibly the AI doesn't know about (not that it "knows" anything).
If this doesn't work, post what you get as the result and I can try to help!