Docs
Update based on field
Update based on field
When using overwrite mode with run once requests, you specify how Otera updates existing Notion rows by matching data based on unique field values that exist in your Notion database and the API response (such as an ID
field).
How to update based on unique matching fields
- Create a new request or open an existing one
- After connecting to Notion, setting the request options, and mapping database fields, click the Output options step
- Under Request type, choose Run once
- Under Output mode, choose Overwrite
- Select the source field from the API response and matching Notion field
Example of updating based on unique matching fields
Let's say you have a Notion database that looks like this:
Product ID | Item | Price |
---|---|---|
32 | Headphones | |
523 | Speaker | |
213 | Phone Case |
And your API response looks like this:
[
{
"id": 32,
"name": "Wireless Headphones",
"price": 89.99
},
{
"id": 523,
"name": "Bluetooth Speaker",
"price": 45.5
},
{
"id": 213,
"name": "Phone Case",
"price": 12.99
}
]
The id
field in the API response corresponds to the Product ID
field in your Notion database, so you can:
- set Source field to
id
- set Notion field to
Product ID
- For each API response item, Otera will look for a row where the
id
value matches the field value ofProduct ID
. - If it finds a matching row, it will update it.
- If it doesn't, it will either do nothing or create a new record if Create records not found in Notion database is enabled.
Result after import:
Product ID | Item | Price |
---|---|---|
32 | Headphones | 89.99 |
523 | Speaker | 45.50 |
213 | Phone Case | 12.99 |
Best practices
- Ensure matching field values are unique in your database
- Before running a request on a large database, ensure that your settings work by testing in a smaller database with sample fields