Select to view content in your preferred language

Alternative to GetEnvironment() in Field Maps

167
3
4 weeks ago
TL2
by
Frequent Contributor

I would like to use a statement to tell if I am on the web or native platform.  It seems like GetEnvironment() is still not supported in Field Maps, any alternative?

0 Kudos
3 Replies
KerriRasmussen
Esri Contributor

Hi @TL2 . Could you tell me more about your workflow? What is the end goal you are hoping to achieve? 

0 Kudos
TL2
by
Frequent Contributor

I would like to show Arcade content (survey123 links) when users access the pop ups in field maps and hide the links in the web app.

0 Kudos
TracyLove
Emerging Contributor

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'
}

0 Kudos