Arcade Feature-Set Works but Does Not Display in Popup

623
2
Jump to solution
03-11-2019 02:30 PM
Amanda__Huber
Regular Contributor

Hi All, 

We recently constructed an Arcade expression using Feature-Sets. The arcade expression validates but does not display in the popup. It's a simple text string that should display. Even if we change the return to an arbitrary word like "test" it still does not display in the popup. Please see images below. Expression is in text form at the bottom of the post. 

Any other arcade expressions work fine in this web map and popup. 

Explanation of the expression: 

We're displaying a string of text that falls under three parameters NotesOrObservation is Observation, SpeciesType is House Wren, and DateofObservation is Current Year. Since "AND" statements don't seem to be a supported Arcade function we used the below. 

-  Feature-Set is looking at the related table in the map

-  Sorting by "DateOfObservation" date descending

-  If parameter is met "Yes" is returned

- Return is a concatenation of three parameters

      example) If all three parameters are Yes then "yesyesyes" is returned 

Arcade Expression and Result: 

Expression in popup configuration: 

Popup Blank Return: 

Expression: 

var Related= FeatureSetByName($datastore,"BlueBird_Boxes_Records")
var sort = OrderBy(Related, "DateOfObservation Desc")
var top1= Top(sort, 1)
for (var x in top1){var species = x.SpeciesType; var NoteOB = x.NotesorObservation;var DateOB = x.DateOfObservation}
var yesno = ''
iif (species == 'House Wren', yesno += 'yes', yesno +='no')
iif (NoteOB == 'Observation', yesno += 'yes', yesno +='no')
iif (Year(DateOB) == Year(Now()), yesno += 'yes', yesno +='no')

return yesno

0 Kudos
1 Solution

Accepted Solutions
Amanda__Huber
Regular Contributor

Hi Russell Roberts

Thanks so much for your quick response.

It does look like switching it to an if-else instead of iif works! Do you know if there is a reason for this?

Thanks!

View solution in original post

2 Replies
RussellRoberts1
Esri Frequent Contributor

Can you try using if-else in your expression instead of iif. 

Thanks!

Russ

Amanda__Huber
Regular Contributor

Hi Russell Roberts

Thanks so much for your quick response.

It does look like switching it to an if-else instead of iif works! Do you know if there is a reason for this?

Thanks!

View solution in original post