Action referencing
Sometimes it is useful to access data from a previous action in a new action.
The following actions expose data after execution:
Action Name | Data Binding | Returns |
---|---|---|
Save Row | {{ Action X.Saved Row }} | Field value pairs (including auto-columns) _id: Unique row identifier |
Duplicate Row | {{ Action X.Duplicated Row }} | Field value pairs (including auto-columns) _id: Unique row identifier |
Execute Query | {{ Action X.Query Result }} First row example |
|
Note X is the action number
Example: Creating and Linking two table entries in one form
Schema
- Bookings
- Leaders
- One Booking -> One Leader
Use Case
Create a new booking and a new associated leader in one form
Steps
- In the /booking/new/row screen, delete the drop down for the leader, and replace it with a new text field. Type in the field name: LeaderName
- Next click on the 'Save' button and 'Define actions'.
Here you will need to add another 'Save Row' action underneath the existing one for the Leader table. This will allow you to create a new row for the leader entered into the in-line LeaderName field.
- Two columns overrides must be added.
The first Name{{ Form.Fields.LeaderName }}
saves the leader name as the value from our new LeaderName form field.
The second Booking column (the relationship field) is set to{{ Action 2.Saved row._id }}
. This represents the relationship id of the booking row that was saved in the previous action.
Updated 10 days ago
Did this page help you?