Cannot even get GetEnvironment() to run. If its blank that is fine but it just fails totally.
Is this not support yet?
thanks
Hi Doug,
Good afternoon. Where are you using GetEnvrionment()? Can you give some more context on how you are trying to use the function?
Thanks,
Kerri
I was helping a user that wanted to use line breaks. Since NewLine does not work in Field Maps you use <br/>. But then that is ugly in map viewer.
So I helped them write code using GetEnvrionment() and it works great in the map. But in Field Maps it says expression failed. We also tested GetEnvrionment() for IsEmpty and "" but it just fails right away. So my guess is Field Maps GetEnvrionment() is not set supported.
Arcade still has no try except (which it really should) so that is about as far as we can test.
Is GetEnvrionment() supported in Field Maps?
thanks
Good Morning Doug,
Currently the GetEnvironment() function is not supported in ArcGIS Field Maps, however it will be supported in future releases of the software. I do want to thank you for sharing your use case, this helps us while we develop the software. Keep an eye on the What's New Blog for Field Maps for when Runtime 200.2+ is supported.
Thank you,
Kerri
Thanks the user ended up changing to an Arcade box and doing all HTML which works in both.
Yes a reliable way to determine context is needed. getenvironment has been available for about 2 years now. kinda telling that this has not been solved after all these years.
//my hack way to try to figure out if we are online or in field maps
var PointGeometry = Centroid(Geometry($feature));
var ArcadeSr = PointGeometry.spatialReference.wkid;
var application = ArcadeSr
if (ArcadeSr == 102100) {
application = 'AGOL online edit'
} else if (ArcadeSr == 3857) {
application = 'GPS in FieldMaps'
}