Select to view content in your preferred language

Advanced formatting in List is showing up in box.

519
2
Jump to solution
04-18-2023 10:13 AM
Labels (1)
JanelleShank
Emerging Contributor

Hello, 

I am looking for a solution to some advanced formatting in the List widget on ArcGIS Dashboards. 

I have a hosted table with dates in one of the data fields. However some do not have dates. Therefore, I want to have those that do not have dates to say "Not Submitted" on the  list. My script is running but it is not displaying anything when there is an empty field. Please see my script below. 

 var empty = $datapoint.Discipline_Review_Due_Date
 if(empty == ''){
  return empty + "Not Submitted"
 }
return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
    attributes: {
    dept: empty,
  }
}
 
Thank you,
Janelle 
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

Use IsEmpty to check whether there are no dates and don't use the return statement in the "if" function.

 

 var empty = $datapoint.Discipline_Review_Due_Date
 if(IsEmpty(empty){
  empty = "Not Submitted"
 }
return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
    attributes: {
    dept: empty,
  }
}

 

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

Use IsEmpty to check whether there are no dates and don't use the return statement in the "if" function.

 

 var empty = $datapoint.Discipline_Review_Due_Date
 if(IsEmpty(empty){
  empty = "Not Submitted"
 }
return {
  textColor: '',
  backgroundColor: '',
  separatorColor:'',
  selectionColor: '',
  selectionTextColor: '',
    attributes: {
    dept: empty,
  }
}

 

JanelleShank
Emerging Contributor

Thank you so much!! That worked perfectly!

0 Kudos