# Save Record

This action will insert a new record or update specific fields of an existing record on a collection.

![](https://2678899722-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdPD9c4fJbXSAZcPHt9%2F-M_bV-H-OgPpYGSf3o-z%2F-M_bVB4R8SinoZn_YrGf%2Fimage.png?alt=media\&token=72aad385-cdaf-4c2b-9f6d-1359940e8df1)

### Settings

The action uses the following settings:

| Setting          | Description                                                                                                                                                                           | [Parsed](https://docs10.xenioo.com/actions-and-operations/dynamic-parsing) |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
| Collection       | The collection to be used for the action                                                                                                                                              | :no\_entry:                                                                |
| Save Mode        | Set whatever the save action should fully replace any data in the existing record or only update the specified fields                                                                 | :no\_entry:                                                                |
| Record Unique Id | The unique id of the record to be deleted. If left empty,[ Filter Operations](https://docs10.xenioo.com/actions-and-operations/database/set-field-filter-value) will be used instead. | :white\_check\_mark:                                                       |

### Remarks

This action alone does not produce any result. At least one [Field Operation](https://docs10.xenioo.com/actions-and-operations/database/set-field-value) must be attached for the action to be executed. Assuming we want to increase by 50 the cost of a product with a specific id, a complete Save Record action may look like the example below:&#x20;

![](https://2678899722-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LdPD9c4fJbXSAZcPHt9%2F-M_bW5ZwNLHN9-nWuYv7%2F-M_bX-404YJjqwBwP9h9%2Fimage.png?alt=media\&token=76daace2-3d30-4fa4-a357-e2922ee37fbd)

If no unique id is specified for the record or no record exist with the specified value, the Save Mode will be automatically set to replace whole record mode.

### Trigger

This action automatically triggers all of the [Set Field operations](https://docs10.xenioo.com/actions-and-operations/database/set-field-value) attached.

### Variables

This action produces the following variables after being triggered:

| Variable                   | Description                                                    |
| -------------------------- | -------------------------------------------------------------- |
| last\_database\_object\_id | The unique id of the record that has been updated or inserted. |

### Availability

Channel specific availability follows the table below:

| Channel          | Availability     |
| ---------------- | ---------------- |
| Facebook         | Fully Available. |
| WhatsApp         | Fully Available. |
| SMS              | Fully Available. |
| Telegram         | Fully Available. |
| Web              | Fully Available. |
| Alexa            | Fully Available. |
| Google Assistant | Fully Available. |
| Slack            | Fully Available. |
| API              | Fully Available. |

This action requires an active [Database ](https://docs10.xenioo.com/basic-concepts/your-account/additional-packages)package.
