Formatting cell values of a table added with table widget to dashboard

332
2
Jump to solution
02-28-2024 09:38 AM
ellipsol
New Contributor III

I added a table widget and connected it with a table in a dashboard. I want to format select cell values. I'm think I could manage this with Arcade, similar to what's below. Is there a way to handle this table formatting in a dashboard?

var bld = Concatenate('<strong>'+$feature.LT2_Difference+'</strong>')


# Format where values are less than or equal to -1
var val = When($feature.LT2_Difference <= -1, bld, $feature.LT2_Difference);

return{
LT2_Difference: {
      displayText : val,
      textColor: '',
      backgroundColor: '#e0e0e0',
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    }
}

 

Tags (2)
2 Solutions

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

You can find the Advanced Formatting for tables under the Values tab. Each column will have its own section of the return statement.

JenniferAcunto_0-1709150250028.png

 

- Jen

View solution in original post

ellipsol
New Contributor III

Thank you, I misspoke and realize I was trying in Experience Builder, not a Dashboard. I got a minimum working example with your response, in a Dashboard.

var bgcolor = When($datapoint.diffVal <= -1, '#CC0000', '')
var tcolor = When($datapoint.diffVal <= -1, '#111', '') 

return

return {
  cells: {
    LT2_Difference: {
      displayText : $datapoint.diffVal,
      textColor: tcolor,
      backgroundColor: bgcolor,
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
}
}

 

View solution in original post

0 Kudos
2 Replies
JenniferAcunto
Esri Regular Contributor

You can find the Advanced Formatting for tables under the Values tab. Each column will have its own section of the return statement.

JenniferAcunto_0-1709150250028.png

 

- Jen
ellipsol
New Contributor III

Thank you, I misspoke and realize I was trying in Experience Builder, not a Dashboard. I got a minimum working example with your response, in a Dashboard.

var bgcolor = When($datapoint.diffVal <= -1, '#CC0000', '')
var tcolor = When($datapoint.diffVal <= -1, '#111', '') 

return

return {
  cells: {
    LT2_Difference: {
      displayText : $datapoint.diffVal,
      textColor: tcolor,
      backgroundColor: bgcolor,
      textAlign: 'right',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
}
}

 

0 Kudos