Connect a record based on a key + Create if not found
Search for a record and link it to a different record or create a new one to link
![Screen Shot 2022-08-15 at 17.06.23.png 754](https://files.readme.io/a1053e5-Screen_Shot_2022-08-15_at_17.06.23.png)
With the action “Connect a record based on a key + Create if not found”, you can search for a record and link it to a different record or create a new one to link automatically when the chosen trigger is activated.
Trigger -> Action
The most important thing about a trick is understanding its conditions and actions. They have a simple generic structure:
When the condition (trigger) happens, then do (action).
Trigger -> Action
How to create
You just have to click on the "+ Automations" icon on the upper right corner of the screen to open the No code automations panel, and then on the "+ Create new automation" button:
![Screen Shot 2022-08-15 at 18.08.43.png 464](https://files.readme.io/ce904ea-Screen_Shot_2022-08-15_at_18.08.43.png)
Select the trigger of your choice to activate the action, then select the "Connect a record based on a key + Create if not found" action, and fill in the options:
- Table to search record on:
- Select the table where you want to search the record (for example, "Clients")
- Field to search the value:
- Select the field where the key value is (for example, "Email" if you're searching a "Client" by their email)
- Value to be searched:
- Select the key value to search for
![Screen Shot 2022-08-22 at 14.43.44.png 788](https://files.readme.io/6911a12-Screen_Shot_2022-08-22_at_14.43.44.png)
- Table to link connected record:
- Select the table where you the record you're going to connect is (for example, "Reservations")
- Field to link connected record:
- Select the Connect tables field that points to the previous table
- Record to link connected record to:
- Select the id of the record that will be linked to the record you searched
![Screen Shot 2022-08-22 at 14.46.35.png 788](https://files.readme.io/bab5a4c-Screen_Shot_2022-08-22_at_14.46.35.png)
- Set creation values if no matching record is found:
- Specify how a new record must be created in case the search returns empty
Click on save
![Screen Shot 2022-08-22 at 14.46.18.png 788](https://files.readme.io/a228d83-Screen_Shot_2022-08-22_at_14.46.18.png)
Updated almost 2 years ago