Select to view content in your preferred language

Conditional Formating in Tables using Advanced formatting

710
2
02-22-2022 07:48 AM
Labels (2)
VerleyAltamirano
Occasional Contributor

Hello,

I am creating a table with data collected in a survey, these data are discrete, my idea is to condition the data, for example, if the value is "0" it changes the format of the field to red and if it is "5" it changes to green.

It is a simple process in an indicator, the problem is to define each of the cells to format the table depending on the column.

Can someone help me with the initial syntax to be able to find what I'm looking for?

VerleyAltamirano_0-1645544919670.png

 

 

 

 

0 Kudos
2 Replies
abelvang_3ID
New Contributor

Verley, 

Something I've been playing with is the variables in the settings . Some of the Arcade coding I'm testing out is as follows:
var color= IIF($datapoint.[input location] = 0 , 'red', '')

var color = IIF($datapoint.[input location] > 4, 'green','')

then doing this to the values

[INPUT LOCATION]: {
      displayText : Text($datapoint.[input location]),
      textColor: '',
      backgroundColor: color,
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
try that and see if it gives you what you're looking for.
0 Kudos
abelvang_3ID
New Contributor

You can also reference the link below for further help on this. 

https://doc.arcgis.com/en/dashboards/10.9.1/create-and-share/advanced-formatting.htm

 

0 Kudos