Select to view content in your preferred language

Using Arcade for Dynamic Text in Indicator

2344
8
Jump to solution
01-05-2023 07:50 PM
KhadijaSafi
Emerging Contributor

Hello, 

In the advanced formatting settings I'm trying to use arcade to display the text data within the field the indicator is referencing. This is my code  

var cat = $datapoint["count_Asset_Group"]
return {
    //textColor:'',
    //backgroundColor:'',
    topText: cat,
    topTextColor: '',
    topTextOutlineColor: '',
    topTextMaxSize: 'medium',
    middleText: $datapoint["count_Asset_Group"],
    middleTextColor: '',
    middleTextOutlineColor: '',
    middleTextMaxSize: 'large',
    //bottomText: '',
    //bottomTextColor: '',
    //bottomTextOutlineColor: '',
    //bottomTextMaxSize: 'medium',
    iconName:'icon1',
    iconAlign:'left',
    iconColor:'',
    iconOutlineColor:''
    //noValue:false,
    //attributes: {
      // attribute1: '',
      // attribute2: ''
    // }
  }

However, the top text is only showing the number of times the value in the field shows up when I want it to show the actual text of the field ex. House, Car....

KhadijaSafi_0-1672976977716.png

This is a screen shot of how I configured the data in my indicator

KhadijaSafi_1-1672977035995.png

 

 

 

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

You can hack it by grouping a feature mode indicator to the top of the summary indicator. Just pick a random value to display, then add the category field to the top text and remove the value field from that indicator. 

2023-01-06_13-41-24.jpg

Set it to only render when the category selector has been used to filter it and then change the 'selection' message to 'All'. 

Untitled Project.gif

- Jen

View solution in original post

0 Kudos
8 Replies
jcarlson
MVP Esteemed Contributor

You have them both set to $datapoint["count_Asset_Group"] so they will be showing the same text. What value are you expecting to see there?

When you're editing your Arcade expression, you should have the option of expanding the view:

jcarlson_0-1673017265468.png

This will allow you to see all the available globals. Depending on how you have your indicator configured, there may not be any global with the value you need.

- Josh Carlson
Kendall County GIS
0 Kudos
KhadijaSafi
Emerging Contributor

I want to see the value of the deficiency. When I change the selection in the selector below it updates the indicator, but I want the indicator to say which deficiency it is.

KhadijaSafi_0-1673033886145.png

 

0 Kudos
jcarlson
MVP Esteemed Contributor

I don't think an Indicator can do that on its own. You could possibly use a Data Expression to create your aggregated counts, then set the Indicator to Feature mode, rather than showing statistics. But that might be more trouble than it's worth.

- Josh Carlson
Kendall County GIS
0 Kudos
JenniferAcunto
Esri Regular Contributor

You can hack it by grouping a feature mode indicator to the top of the summary indicator. Just pick a random value to display, then add the category field to the top text and remove the value field from that indicator. 

2023-01-06_13-41-24.jpg

Set it to only render when the category selector has been used to filter it and then change the 'selection' message to 'All'. 

Untitled Project.gif

- Jen
0 Kudos
KhadijaSafi
Emerging Contributor

That allowed me to have the deficiency type value show but now the number doesn't show up.

KhadijaSafi_0-1673038731302.png

I think there needs to me something in the middle text but the $datapoint["count_Asset_Group"] doesn't work now. 

KhadijaSafi_1-1673038820010.png

 

0 Kudos
JenniferAcunto
Esri Regular Contributor

You would have my feature indicator to handle the text, and your statistic indicator to handle the value. You then hold down shift while dragging one to the other to 'group them'. You can't do it all in a single indicator unless you're going to go down @jcarlson's data expression route.  

- Jen
0 Kudos
KhadijaSafi
Emerging Contributor

Okay, I used two indicators and now it displays properly. Thanks for your help!

0 Kudos
TD1
by
Frequent Contributor

@JenniferAcunto I can't seem to get your solution to work. The data changes but I can't get the text to change. I want the text to change from active to inactive when the category selector is changed just like the data

Also between your 2 indicators there is no separator line. How did you do that?

0 Kudos