> For the complete documentation index, see [llms.txt](https://docs.carto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carto.com/carto-user-manual/app-studio/data-in-your-app.md).

# Data in your app

How an app reads and saves your data, runs workflows, and what the people you share it with can see and do

{% hint style="info" %}
**Private Preview:** App Studio is available to selected accounts during its Private Preview. To request access, contact your CARTO representative.
{% endhint %}

Apps work on live data in your data warehouse, through your CARTO [connections](https://docs.carto.com/carto-user-manual/connections.md). Nothing is copied.

## Data sources

An app can only use the data sources it declares. Each one is either:

* **A table**, or
* **A named source**: a SQL query stored in CARTO and called by name. The assistant uses one for joins, aggregations, or anything a single table can't do.

The assistant adds and removes sources as it builds. The studio's **Data** tab lists the current ones, with the SQL behind each named source.

<figure><img src="https://3029946802-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FybPdpmLltPkzGFvz7m8A%2Fuploads%2Fgit-blob-876ee8a3aceabbeff3f9edf88d0d841830640846%2Fapp-studio-data-tab.png?alt=media" alt="The Data tab listing the app&#x27;s sources: two named sources and a table, with the SQL of the selected named source"><figcaption></figcaption></figure>

The SQL stays in CARTO and never reaches the browser or the app's code. The app's code can't add data access either: the only way to change what an app can use is to change its sources, and every change is saved in the [version history](https://docs.carto.com/carto-user-manual/app-studio/version-history.md). This is the same mechanism developers use with [Named Sources](https://docs.carto.com/carto-for-developers/guides/avoid-exposing-sql-queries-with-named-sources.md).

## Saving results and running workflows

A named source can do more than read. Ask for it in your prompt and the app can:

* **Save results** to your warehouse, such as a decision, a status or an edited record, with an `INSERT`, `UPDATE` or `MERGE` source.
* **Run a workflow** and show its output. The workflow needs [API access](https://docs.carto.com/carto-user-manual/workflows/executing-workflows-via-api.md) enabled in **Sync** mode.

The assistant confirms with you what the app may change before it adds one of these sources.

{% hint style="warning" %}
**Anyone who can open the published app can save data or run workflows through it.** Keep writes to specific tables, and share the app only with the people who should make those changes.
{% endhint %}

## Who sees what

**While you build**, the assistant explores your connections with your own permissions, so it only finds the data you can access. The preview can only use the sources the app declares.

**Once published**, the app uses its own access, not the access of the person who opens it:

* **Everyone who can open the app sees its data**, even if they can't access that connection themselves.
* **They can't use anything else.** The app has no access beyond its declared sources.

{% hint style="warning" %}
Before you share an app, check its **Data** tab. Everything listed there is available to everyone you share it with.
{% endhint %}

Changes to the data sources reach the published app only when you [update it](https://docs.carto.com/carto-user-manual/app-studio/publishing-and-sharing.md#updating-a-published-app).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.carto.com/carto-user-manual/app-studio/data-in-your-app.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
