Update Location
The Update Location interaction captures the device's current geographic coordinates and stores them for use by the component.
Overview
The Update Location interaction updates the device's geolocation โ its latitude and longitude โ by requesting the current position from the browser or device. Use it when your component needs the user's current coordinates for location-based logic, such as stamping a record with where an action took place or propagating the position to other interactions.
Because the coordinates come from the browser or device, the user is typically prompted to grant location access the first time the interaction runs.
Configuration
The interaction runs when its triggering event fires (for example, an On Click on a button). It has no input settings of its own โ you configure what happens after the location is retrieved:
On Success: The interactions to execute once the location has been updated successfully. Accepted follow-up interactions are: Show Toast, Refresh All Queries, Refresh Query, Get Record, and Assignment.
On Error: The interactions to execute if the location update fails (for example, the user denies location access or the device cannot determine a position). Accepted follow-up interactions are the same set: Show Toast, Refresh All Queries, Refresh Query, Get Record, and Assignment.
Example
Goal: Let a user record their current location with a single button click.
Add an Avonni Button component (e.g., "Update My Location").
Add an On Click interaction and set the Action Type to
Update Location.On Success: Add a Show Toast (Success variant) to confirm the location was captured.
On Error: Add a Show Toast (Error variant) so the user knows the location could not be retrieved.
Last updated
Was this helpful?
