I have an ArcGIS Dashboard and a List element where I want to use 2 separate fields: called {Well_Name} and {FacilityName}. By just putting in both fields I get an unsatisfactory list, where if there is not a Well_Name attribute, but a FacilityName attribute, it puts a NA in front of the FacilityName. The opposite occurs if there is Well_Name attribute, but not a FacilityName, by putting a N/A after the Well_Name. There must be a way to populate a List element from 2 separate fields. Would this be easier as an Arcade expression in the web map popup or in the Dashboard?
Solved! Go to Solution.
If you click "Enable" in the advanced formatting section, you can create your own arcade variables to use in your list. So if it's a case where both names could be populated, it might look something like:
var wellNameFormatted = Iif($datapoint.Well_Name == "N/A", "", $datapoint.Well_Name)
var facilityNameFormatted = Iif($datapoint.FacilityName == "N/A", "", $datapoint.FacilityName)
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
Well: wellNameFormatted,
Facility: facilityNameFormatted
}
}
And then you would reference it in your list as {expression/Well}{expression/Facility}
Or if it's only possible for one or the other to have a name, you could do it with one variable like this:
var nameFormatted = Iif($datapoint.Well_Name == "N/A", $datapoint.FacilityName, $datapoint.Well_Name)
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
Name: nameFormatted
}
}
And just reference {expression/Name}
If you click "Enable" in the advanced formatting section, you can create your own arcade variables to use in your list. So if it's a case where both names could be populated, it might look something like:
var wellNameFormatted = Iif($datapoint.Well_Name == "N/A", "", $datapoint.Well_Name)
var facilityNameFormatted = Iif($datapoint.FacilityName == "N/A", "", $datapoint.FacilityName)
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
Well: wellNameFormatted,
Facility: facilityNameFormatted
}
}
And then you would reference it in your list as {expression/Well}{expression/Facility}
Or if it's only possible for one or the other to have a name, you could do it with one variable like this:
var nameFormatted = Iif($datapoint.Well_Name == "N/A", $datapoint.FacilityName, $datapoint.Well_Name)
return {
textColor: '',
backgroundColor: '',
separatorColor:'',
selectionColor: '',
selectionTextColor: '',
attributes: {
Name: nameFormatted
}
}
And just reference {expression/Name}
Thank you very much, it worked like a charm!