Winter greetings,
I've got a Dashboard Table with 3 columns:
However... there are a couple of cells in columns 2 and 3 that are null/empty and will remain that way. I'd like for those cells not to display a clickable link that goes nowhere, and instead to simply show up as empty. I can't figure out where in the code to put the if(IsEmpty()) variables. Column 1 I need to remain as-is. Below is my working code:
return {
cells: {
TreatyImp: {
displayText : $datapoint.TreatyImp,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Topo: {
displayText : `<a href="${$datapoint["Topo"]}" target="blank">Download Topo Map</a>`,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Aerial: {
displayText : `<a href="${$datapoint["Aerial"]}" target="blank">Download Aerial Map</a>`,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
}
}
Any pointers in the right direction would be appreciated.
-r
Solved! Go to Solution.
Give this a try
var topoText = When(IsEmpty($datapoint["Topo"]), '', `<a href="${$datapoint["Topo"]}" target="blank">Download Topo Map</a>`)
var aerialText = When(IsEmpty($datapoint["Aerial"]), '', `<a href="${$datapoint["Aerial"]}" target="blank">Download Aerial Map</a>`)
return {
cells: {
TreatyImp: {
displayText : $datapoint.TreatyImp,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Topo: {
displayText : topoText,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Aerial: {
displayText : aerialText,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
}
}
Give this a try
var topoText = When(IsEmpty($datapoint["Topo"]), '', `<a href="${$datapoint["Topo"]}" target="blank">Download Topo Map</a>`)
var aerialText = When(IsEmpty($datapoint["Aerial"]), '', `<a href="${$datapoint["Aerial"]}" target="blank">Download Aerial Map</a>`)
return {
cells: {
TreatyImp: {
displayText : $datapoint.TreatyImp,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Topo: {
displayText : topoText,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
Aerial: {
displayText : aerialText,
textColor: '',
backgroundColor: '',
textAlign: 'left',
iconName: '',
iconAlign: '',
iconColor: '',
iconOutlineColor: ''
},
}
}
@KenBuja you're amazing! Thanks for the fix. BTW, I've been chasing rabbitholes on these boards and have learned a lot from your posts and responses to others!