I am wondering if it is possible to create an "if" or "iif" statement in a dashboard.
More specifically in Details or List.
I have tried a variety of options.
var cracking = $feature.FOUNDATIONCRACKING:
iif(cracking = 'Yes', 'Var1','Var2')
iif($feature.FOUNDATIONCRACKING = 'Yes', 'Var1','Var2')
We are using Enterprise and Portal
The information is coming from a Survey and is stored as part of a feature.
My intent for the results of this is when a answer is an aberration that I can make the font red.
In this example FOUNDATIONCRACKING is a question as to whether or not the foundation is cracking. If the answer is Yes I want to do something like this for the results of the "if" statement
<font color='red'>FOUNDATIONCRACKING</FONT>,FOUNDATIONCRACKING
Solved! Go to Solution.
What version of Enterprise? In more recent versions where Arcade is available in Dashboards, this is fairly simple. In the Advanced formatting area, just use the expression you've given to create a "font color" variable, and pass that into the returned dictionary.
If you are on an earlier version, there's no way to accomplish this without a static field value, unfortunately.
What version of Enterprise? In more recent versions where Arcade is available in Dashboards, this is fairly simple. In the Advanced formatting area, just use the expression you've given to create a "font color" variable, and pass that into the returned dictionary.
If you are on an earlier version, there's no way to accomplish this without a static field value, unfortunately.
We are at the newest version.
Maybe I am entering it in the wrong place. I wrote it just like your example and this is what I get.
Can you share the Arcade expression you're using? That text shouldn't appear unless it's somehow within the main return statement.
var cracking = $datapoint.['FOUNDATIONCRACKING']:
var f_col = iif(cracking == 'Yes','Red', '')
return {
textColor: f_col
}
And specifically where in the List or Details should I be pasting it?
In the advanced formatting code block. You have to enable advanced formatting for it to appear.
Ahh that could be part of my problem. I don't have the option for Advanced formatting in Dashboards Classic.
it is there for the new dashboards.
We cannot use new Dashboards until ESRI fixes a bug where thumbnails do not show up in the dashboard
I went and activated it in a new dashboard and will try from there.
If the following syntax correct
var cracking = $datapoint.['FOUNDATIONCRACKING']:
var f_col = iif(cracking == 'Yes','Red', '')
return {
textColor: f_col
}
Ah, right! I should have asked, I forget that there are two Dashboards tools at the moment.
Version: 10.9.1 (build 28388) is our server version