# Save Data in Database

The save database data is a function in the [cloud database](/apphive-documentacion/reference/funciones/cloud-database.md) functions which allows to write registers on the database this is a set which saves new data to the specified database path, adding or replacing any existing data at that path.

![](/files/-M-kBlMJlwdzCROD15RU)

### 📥 Entry vars <a href="#entry-vars" id="entry-vars"></a>

* **Should update DB cache:** you could activate this function to update de database cache data.
* **Updates to make to the DB:** you can open the database path to view and modify the database.
* **Database path:** you can open the database path to view and modify the database.

### \*\*\*\*↗ **Callbacks**

* **Error saving data:** you can set functions after the database can't be saved.
* **Data saved:** you can set functions after the database can be saved.

### 👉 Example. <a href="#examples" id="examples"></a>

![](/files/-M3JH1Hg_Y0m5tJG1MiP)

1. Select a button on the screen.
2. Put a on press in functions menu.
3. Activate a save data in database.
4. Open the [database path](/apphive-documentacion/reference/base-de-datos/database-editor/open-database-editor.md).
5. Create a favorite collection.
6. Create two fields, firstly name and secondly direction.
7. Select which element will be used for input on the controller menu.
8. Open the callbacks of in save data in database and add a [send alert](/apphive-documentacion/reference/funciones/notifications/send-alert.md).
9. Put OK in the title of the send alert.

![](/files/-M20FwfyZWuf70Je6Jjq)


---

# Agent Instructions: 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:

```
GET https://docs.apphive.io/apphive-documentacion/reference/funciones/cloud-database/save-data-in-database.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
