> For the complete documentation index, see [llms.txt](https://docs.avonnicomponents.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avonnicomponents.com/dynamic-components/component-builder/interactions/update-location.md).

# 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](/dynamic-components/component-builder/interactions/show-toast.md), [Refresh All Queries](/dynamic-components/component-builder/interactions/refresh-all-queries.md), [Refresh Query](/dynamic-components/component-builder/interactions/refresh-query.md), [Get Record](/dynamic-components/component-builder/interactions/get-record.md), and [Assignment](/dynamic-components/component-builder/interactions/assignment.md).
* **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](/dynamic-components/component-builder/interactions/show-toast.md), [Refresh All Queries](/dynamic-components/component-builder/interactions/refresh-all-queries.md), [Refresh Query](/dynamic-components/component-builder/interactions/refresh-query.md), [Get Record](/dynamic-components/component-builder/interactions/get-record.md), and [Assignment](/dynamic-components/component-builder/interactions/assignment.md).

***

## Example

Goal: Let a user record their current location with a single button click.

1. Add an Avonni Button component (e.g., "Update My Location").
2. Add an On Click interaction and set the Action Type to `Update Location`.
3. **On Success**: Add a [Show Toast](/dynamic-components/component-builder/interactions/show-toast.md) (Success variant) to confirm the location was captured.
4. **On Error**: Add a [Show Toast](/dynamic-components/component-builder/interactions/show-toast.md) (Error variant) so the user knows the location could not be retrieved.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.avonnicomponents.com/dynamic-components/component-builder/interactions/update-location.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
