ArcGIS Solutions: My Trash Services 2.0 (Self Service Facilities web map) - Popup Amenities

437
1
01-17-2023 07:27 AM
Labels (2)
KyleWikstrom
Occasional Contributor II

I am configuring the Self Service facilities web map from the ArcGIS Solutions My Trash Services 2.0 solution, specifically the popup for the Self Service Facilities layer. The popup includes an Arcade element to display which amenity is available based on a Yes/No attribute. The popup is not displaying the amenities that should be displaying. Is there a solution to this?

//Definie the fields in the layer that contain a Yes/No signifying if the amenity is available

var amenity_fields = ['appliances','batteries','constructdebris','electronics','landscaping','automotive']

/*DO NOT CHANGE ANYTHING BELOW THIS LINE

-------------------------------------------------------------------------*/

var amenity_lookup = {};

var layer_fields = Schema($layer)['fields'];

for (var f in layer_fields) {

    var field = layer_fields[f];

    if (IndexOf(amenity_fields, field['name']) > -1) {

        amenity_lookup[field['name']] = field['alias'];

    }

}

var text_ = "";

for(var k in amenity_lookup) {

    if ($feature[k] == 'Yes') {

        text_ += '✓ ' +Replace(amenity_lookup[k], ' ', ' ') + '  ';

    }

}

return {

    type : 'text',

    text : '<strong>Accepts </strong> </br>' + text_ //this property supports html tags

}
 
KyleWikstrom_0-1673969149632.png

 

0 Kudos
1 Reply
JohannesLindner
MVP Frequent Contributor

Are your amenity_fields correct? Capitalization is important here!


Have a great day!
Johannes
0 Kudos