Working on an issue with an incorrectly displayed time field. I need to a field from a rest service to UTC to get the correct date/time (below should be 7/10/2020 12:00am). I don't own the rest service or I would just change it there.
I have tried to use arcade, but because of the way I am building the pop-up, I am getting issues with the calculation.
Any help would be great, thank you!
Solved! Go to Solution.
Ok. I see the issue, you'll need to reference the expression in an expressionInfos object, which will assign it a name. Then you need to refer to that name within the popup content in the following format: {expression/expression-name}. It's the same syntax as referring to field names except you need to prefix the expression name with "expression/".
This is the live sample: https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-arcade/
Hopefully that helps.
Can you describe which issues you're seeing with the UTC calculation in Arcade? Was this the expression you used?
ToUTC($feature.data_project_create)
It's very possible I am applying the arcade in the wrong way. I am getting this in the pop-up
Thank you for your help
Ok. I see the issue, you'll need to reference the expression in an expressionInfos object, which will assign it a name. Then you need to refer to that name within the popup content in the following format: {expression/expression-name}. It's the same syntax as referring to field names except you need to prefix the expression name with "expression/".
This is the live sample: https://developers.arcgis.com/javascript/latest/sample-code/popuptemplate-arcade/
Hopefully that helps.
Thank you @KristianEkenes the screen shots and example are great and I got it working. Thank for you help