Select to view content in your preferred language

Reason for limitation in Arcade expressions

294
3
Jump to solution
05-17-2024 10:47 AM
DanielDuncan
New Contributor II

I am using the Election Result solution of the ArcGIS Dashboard. For some reason I am extremely limited in what I can do with Arcade in terms of referencing and manipulating my data. I have access to only 2 profile variables (datapoint and reference) in my indicator element which don't help in what I am trying to do. Could someone explain this limitation and along with a solution to fix this?

For reference I am trying to use arcade to sum and display the result of values within a field in my underlying attribute table. 

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

It looks like you're trying to use multiple fields from the $reference variable, but that only has the one value set up on the Data tab in the Reference section.

Take a look at using Arcade to create a Data Expression that you'll use as the data source for the indicator. That will give you access to more things. There's a github page on expression examples you can look at for ideas.

View solution in original post

0 Kudos
3 Replies
KenBuja
MVP Esteemed Contributor

It looks like you're trying to use multiple fields from the $reference variable, but that only has the one value set up on the Data tab in the Reference section.

Take a look at using Arcade to create a Data Expression that you'll use as the data source for the indicator. That will give you access to more things. There's a github page on expression examples you can look at for ideas.

0 Kudos
DanielDuncan
New Contributor II

This helped, thank you! However if you could help in one other small problem I'd appreciate it. I am trying to sum two separate fields of data. Once I get both sums, I'd like to add those values and display them in my indicator. But I constantly get the error code "Test execution error: Unknown Error. Verify test data." in the console. Any idea what could be the problem or how I could find out the problem and solve it?

0 Kudos
KenBuja
MVP Esteemed Contributor

It's difficult to to read and test your code when it's in an image. Use the code editor when posting a question about syntax.

A Data Expression must return a FeatureSet, so it won't work with the simple variable you're returning

0 Kudos