Select to view content in your preferred language

ArcGIS dashboard - domain values not showing in advanced formatting on table

369
3
04-30-2026 07:05 AM
LindsayLewin
Occasional Contributor

Hello.  I'm using advanced formatting on a table in dashboard and the domain code is showing from my hosted feature layer rather than the displayed value.  

 

When I set the variable for each code the data disappears all together...am i missing something here or is this a bug?

Any assistance would be greatly appreciated!

 

LindsayLewin_2-1777557850255.png

 

LindsayLewin_1-1777557770028.png

 

LindsayLewin_0-1777557602582.png

var highlight = ''
var textid1 = '' 
 
if ($datapoint.QCStatus == 'Fail'){
highlight = 'RED'
}
 
if ($datapoint.Depth == '1'){
textid1 = '0.00'
}
if ($datapoint.Depth == '2'){
textid1 = '0.05'
}
if ($datapoint.Depth == '3'){
textid1 = '0.10'
}
if ($datapoint.Depth == '4'){
textid1 = '0.15'
}
if ($datapoint.Depth == '5'){
textid1 = '0.20'
}
if ($datapoint.Depth == '6'){
textid1 = '0.25'
}
if ($datapoint.Depth == '7'){
textid1 = '0.30'
}
if ($datapoint.Depth == '8'){
textid1 = '0.35'
}
if ($datapoint.Depth == '9'){
textid1 = '0.40'
}
if ($datapoint.Depth == '10'){
textid1 = '0.50'
}
 
 
 
return {
  cells: {
    ContractorDRID: {
      displayText : $datapoint.ContractorDRID,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    AnomalyAmplitude: {
      displayText : Text($datapoint['AnomalyAmplitude'], '######.00'),
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Tau: {
      displayText : Text($datapoint['Tau'],'######.00'),
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Easting: {
      displayText : Text($datapoint["Easting"], '######.00'),
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Northing: {
      displayText : Text($datapoint["Northing"], '#######.00'),
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Legend: {
      displayText : $datapoint.Legend,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Comments: {
      displayText : $datapoint.Comments,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Depth: {
      displayText : textid1, 
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Disposition: {
      displayText : $datapoint.Disposition,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Team: {
      displayText : $datapoint.Team,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    InvestigatedDate: {
      displayText : Text($datapoint["InvestigatedDate"], 'MM-DD-YYYY'),
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    QCStatus: {
      displayText : $datapoint.QCStatus,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    QCComment: {
      displayText : $datapoint.QCComment,
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'left',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
    Quantity: {
      displayText : Text($datapoint.Quantity),
      textColor: '',
      backgroundColor: highlight,
      textAlign: 'center',
      iconName: '',
      iconAlign: '',
      iconColor: '',
      iconOutlineColor: ''
    },
 
  }
}
0 Kudos
3 Replies
andeb31
Occasional Contributor

When advanced formatting is enabled, the domain code stops being resolved and instead outputs the raw stored value (annoying). Try this:

var depthLabel = DomainName($datapoint, "Depth")

Depth: {
displayText : depthLabel,
textColor: '',
backgroundColor: highlight,
textAlign: 'center',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},

 

That should force using the domain name or value instead of the code.

LindsayLewin
Occasional Contributor

Magic...it worked.  

Thanks so much for the learning.  

Lindsay

tmichael_wpjwa
Frequent Contributor
 
When using Arcade to format a web map pop up I've had to get descriptions using this syntax:
${DomainName($feature, 'MANUFACTURER')}
0 Kudos