Skip to main content
'Commit' action

Saves changes to data accumulated during an automation session to Mapsly database and executes data exchange with the data source.

Sergey Shurygin avatar
Written by Sergey Shurygin
Updated over a week ago

Use Commit in your automation session to save changes in data that have been accumulated in the current execution session, up to the current moment, from Create record, Update record, Delete record actions. Data is saved both to the Mapsly database and the linked data source, and the IDs of the newly created records are populated in the execution session's context, which, for example, enables you to create child records referencing the newly created records in the same execution session.

Example

For example, when you need to create a new Account record, and a new Contact record that should reference this new Account. To create a Contact, you need the ID of the newly created Account.

However, for performance reasons, Mapsly does not immediately save changes in data requested by Create record, Update record and Delete record actions, instead accumulating them in memory while the execution session is in progress and then saving them to the Mapsly database and the linked data source once the execution session finishes.

To obtain the ID of the new Account, use Commit after Create record ( Account ), and then pass the obtained ID to Create record ( Contact ) by filling in the contact's Account ID field with the value {{ lastAction.record.id }}. Here, lastAction references the nested context of the last action, which is Create record ( Account ).

The Commit action does not generate its own nested context โ€” because of this, lastAction still references the nested context of Create record ( Account ). However, if between Create record ( Account ) and Create record ( Contact ) there are other actions that generated nested context thus updating lastAction, you would need to save a reference to Create record ( Account )'s nested context in a named context key.

Did this answer your question?