I realise this seems a very basic question, however, I can't for the life of me get an expression to work - I want to convert wind speed from m/s to mph.
{Wind Speed (m/s)}*2.2
All I get, when inserting the expression is the name of the expression.
It's driving me bonkers!
Does it still give you the expression name on Live View, or if you preview the experience? I occasionally have an expression only display its name in the editing view, but it will work once I switch to the live view.
I've tried live and published views, same result.
I've other expressions within the experience that calculates the difference in footfall over a day - that's works with count (field) - count (other field)
Hi Johnathan,
Have you double checked if the column is in Number format? If it's text format I think calculations won't work. Also, when you insert the field in the expression, does it turn yellow or red?
Hi,
The field is a double and I've the widget linked to data, so it's not showing red. The wind speed field is showing yellow in the expression.
Is that layer Public? I could test it here...
Hi, @JonathanMcDougall -
{Wind Speed (m/s)}*2.2
All I get, when inserting the expression is the name of the expression.
I am not sure what your app looks like, but to make the expression you configured work, you will need to select a feature so that the widget/app would know which data record to convert by the expression you set.
Notice that in the setting it says "Selected features" - I assume that you use this expression with either a Map, a List, or a Feature Info, etc. Try click on the features, and it will show.
If you want to set the expression to show even if there is no selection made, go to the data panel of this one that is being used, and check the "Empty selection" option, or even go in and configure it. It allows you to customize what you want the connected section to show if no selection is made:
You can refer to the details for empty selection here - https://doc.arcgis.com/en/experience-builder/build-apps/select-data.htm. Hope it helps.
Best,
Tonghui
Thanks for the hint. I found this very confusing, it should be selected by default.
Maybe related, when I use some math, it gives me a lot of decimals. Is there a way to format numbers?
No, it's frustrating that we get so many decimal places. If I remember right, I put a suggestion on the Ideas page for dev.