Select to view content in your preferred language

Conditional Formatting Table to Highlight Null Values

419
5
Jump to solution
03-06-2024 12:11 PM
Labels (1)
JustinH
New Contributor III

Hello- 

 

I am currently creating a project management tool using dashboards. The goal is to highlight cells that have no data (null) so we can see who is not entering information in the fields. 

It seems somewhat simple but I am pretty new to arcade. I was thinking that I could go into the text and background formatting for the field and use the IIF function to format this. I do want to apply this for ALL fields so I am guessing there is an easier way to do this. 

 

Thanks in advance. 

0 Kudos
1 Solution

Accepted Solutions
JenniferAcunto
Esri Regular Contributor

The expression you're looking for is 

When(IsEmpty($datapoint.Company), '#F5DDD4', '')

 

But you would need do this for every cell/field. To simplify this you can instead create a function:

function colorGrade(nulls){
  return (
    When(IsEmpty(nulls), '#DB9497', '')
                )
}

 

And then plug in the function in every cell return statement with that specific field in the function.

JenniferAcunto_0-1709815198273.png

 

JenniferAcunto_1-1709815238680.png

 

- Jen

View solution in original post

5 Replies
clt_cabq
Occasional Contributor III

You might look into use the Advanced Formatting available - this article has a section specifically about formatting tables:

Advanced Formatting - tables 

0 Kudos
JustinH
New Contributor III

Thank you for your reply. I am only seeing Advanced Formatting for lists in this article. I am wondering if there is a function that will search for null values in the table and highlight them no matter what data point I define in the expression.

 

0 Kudos
JustinH
New Contributor III

Update: I have used 

// Highlight descriptions with a keyword
var keyword = '';
// Use Find() to determine the index of the word
var hasKeyword = Find(keyword, $datapoint)>=0;
// Update text and background colors if it has the keyword
var txtColorDescription = IIF(hasKeyword, 'red', '');
var bgColorDescription = IIF(hasKeyword, '#F5DDD4', '');
 
Which will atleast apply some sort of conditional formatting to the cells but it will not find only null values. I have also tried null as the keyword. 
 
Still no solution. 
0 Kudos
JenniferAcunto
Esri Regular Contributor

The expression you're looking for is 

When(IsEmpty($datapoint.Company), '#F5DDD4', '')

 

But you would need do this for every cell/field. To simplify this you can instead create a function:

function colorGrade(nulls){
  return (
    When(IsEmpty(nulls), '#DB9497', '')
                )
}

 

And then plug in the function in every cell return statement with that specific field in the function.

JenniferAcunto_0-1709815198273.png

 

JenniferAcunto_1-1709815238680.png

 

- Jen
JustinH
New Contributor III

Wow, thank you so much! This is so helpful.

0 Kudos