Select to view content in your preferred language

Use arcade expression in List element Title

875
2
Jump to solution
08-30-2023 08:33 AM
ColForbin
Frequent Contributor

I have a dashboard in ArcGIS Online with a list element.  The list contains an attribute with currency.  I'd like the sum of the currency to be included in the List title.  Is this possible using arcade and Advanced Formatting?

In the Advanced formatting box I have this as a test:

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  attributes: {
    sum: 'test'
  }
}

  In the Title box of the list element I have included this: {expression/sum}

However, the value of the sum attribute "test" does not show in the title, it shows "{expression/sum}".  In looking at the documentation it seems that this is possible.

I've also tried this but the attribute sum still won't display in the title:

return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
  attributes: {
     dollars: '$0'
  },
  sum: 'test'
}

 

Any ideas how to reference an attribute from an Arcade expression in the Title of a list element?

0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Unfortunately it isn't possible, at least not this way. That arcade expression is evaluated per feature, so there won't be access to the sums outside of an individual list item.

If you need to show a statistic like that, just use an indicator widget and group it together with the list so it appears seamlessly above it.

- Josh Carlson
Kendall County GIS

View solution in original post

2 Replies
jcarlson
MVP Esteemed Contributor

Unfortunately it isn't possible, at least not this way. That arcade expression is evaluated per feature, so there won't be access to the sums outside of an individual list item.

If you need to show a statistic like that, just use an indicator widget and group it together with the list so it appears seamlessly above it.

- Josh Carlson
Kendall County GIS
ColForbin
Frequent Contributor

Thank you, Josh, this is a good workaround.

0 Kudos