The Write to a Database action node enables you to write values from your module into a database and store them there.
Use the Write to a Database action
First, create a Write to a Database action. Then, select a database to write to. In the INPUT section, the fields of the database will appear. Reference the variables whose values should be written into the database as a new record. Activate Expose written values to add the values you have written to the database to the output variable available in the module if you would like to reference the values in a subsequent node.
The record ID
Every database record requires an ID. If you leave blank the ID-field, a new ID for the new record will be created consisting of letters and numbers. This ID also will be returned by the Write to a Database action and can be used or referenced in subsequent nodes in the module.
If you select an ID that already exists in the database, the record will be overwritten for all fields that are not blank in the Write to a Database action. Fields that are blank will keep their existing values in the database even when the record is overwritten.
Environment considerations
Write to a Database actions always write to the environment in which they are used. If you are using your module in Test, it will write values to the Test version of the database. If you are using it in Live or in a client-specific environment, it will write to the Live or client-specific version of the database.
If you are using your module in Preview, it will not write to any database.
Related topics
- To read from a database, use the Read from a Database action.
- If you want to delete records from a database via a module, use the Delete From a Database action.
- To write a collection into a database, use the Batch Process action.
- To delete records in a database as an admin, see here.
- To update a database with an Excel sheet, use the Import feature in data management.