How to use Arcade for List in ArcGIS Dashboard?

2024
4
Jump to solution
08-04-2021 07:43 AM
JennyKuan
New Contributor III

Hi,

I'm relatively new to using Arcade and I have been scouring the Internet, trying to figure out how to use Arcade Expressions for the List widget on Dashboard. I am simply trying to display my data like a table, using the List widget. I know that a Table widget is currently in the works but, in the meantime, I would like to use Arcade within the List widget to display my data. 

So far, I haven't had any luck getting my data to display in the List widget when using Arcade Expressions. The "Feature" functions don't work for me at all and I only have "$datapoint" available as my Global functions. I don't understand the difference between the two. 

I have found a few posts where people are using Arcade to display their data in a table format but, I have tried to replicate their expressions with no success. 

Here is my data:

JennyKuan_0-1628087362479.png

I'm hoping to display the data in a table and for it to look something like this:

JennyKuan_5-1628088131806.png

 

And here's how it gets displayed in under the Advanced Formatting, in the List widget:

JennyKuan_1-1628087417075.png

JennyKuan_2-1628087456769.png

As you can see, FeatureSet, FeatureSetByAssociation, etc. are unavailable to me. I also tried using any function with my data just to see what it would look like:

JennyKuan_3-1628087758312.png

And it doesn't work as I have to use FeatureSet. 

 

Is there anything wrong with my data? I don't know how to get "FeatureSet" to display on the List widget. I looked to see if FeatureSet was available to me in the pop-ups and it is:

JennyKuan_4-1628087905415.png

 

I tried following these instructions to display my data in the List widget, in a table-like format: https://community.esri.com/t5/arcgis-dashboards-questions/arcade-dashborad-add-new-values-into-hoste...

 

Any insight would be helfpul!

 

Thank you,

 

Jenny

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Yes, that's correct. To write the expression, you'd need to use FeatureSetFromPortalItem to bring in your layers.

Look at the sample expressions here for some guidance. They can be very flexible in what they do and the kind of data they return, but there should be one or two examples in that repo to get you started. You can also look around the Community to find other posts about Data Expressions that include code snippets.

- Josh Carlson
Kendall County GIS

View solution in original post

4 Replies
jcarlson
MVP Esteemed Contributor

So are you looking to aggregate your data by certain fields? That's not really what the List widget does, unless you use a Data Expression.

- Josh Carlson
Kendall County GIS
JennyKuan
New Contributor III

Hi Josh,

 

Would I write the Data Expression here?:

JennyKuan_0-1628091187403.png

And write them here:

JennyKuan_1-1628091207380.png

 

Since I didn't pick any layers, there is nothing under "Globals" so, how would I write the expressions?

 

Thank you!

 

 

0 Kudos
jcarlson
MVP Esteemed Contributor

Yes, that's correct. To write the expression, you'd need to use FeatureSetFromPortalItem to bring in your layers.

Look at the sample expressions here for some guidance. They can be very flexible in what they do and the kind of data they return, but there should be one or two examples in that repo to get you started. You can also look around the Community to find other posts about Data Expressions that include code snippets.

- Josh Carlson
Kendall County GIS
JennyKuan
New Contributor III

Awesome, it worked! I'm able to run simple things with it now:

JennyKuan_0-1628098136739.png

 

Thank you so much for your help!

 

Jenny

0 Kudos