Select to view content in your preferred language

Add MapContext to Form Calculation and Constraint Arcade Profiles

06-04-2022 10:14 AM
Regular Contributor

This is similar to $editcontext.editType.

I'm not sure that MapContext is the correct name for this.  It could be connectivityContext, or networkContext, but let's go with MapContext for now.

Add $mapcontext.mapState to the Form Calculation and Constraint Arcade Profiles.  It would return either "Online" or "Offline".   I could write it to an attribute in my schema to store the state or use it to inform other actions.

Generally, I might want to know which map version was used or whether a user collected the data in an online map or offline map.

In the event that we have the ability to make web requests in the future, from within the mobile app or web map viewer, this would serve as an option to help to shut down any attempt to do so if we were offline.



This might just be a property of the existing $editcontext.  Perhaps $editcontext.editState (returns Online or Offline).

1 Comment

This was just introduced in Arcade version 1.23 with the addition of the "GetEnviornment" function.

As of the June 2023 AGO release, it not fully supported across all platforms.  It will likely not have support in Pro until 3.2 and Enterprise (AGE) until 11.2.