Docs
Update based on variables (i.e. table values)

Update based on variables (i.e. table values)

When you use a run for each row request type, you can use values from your Notion database in API requests.

  • We use variables to define the values we want to use in the API request.
  • Variables are denoted by starting and ending curly braces, e.g. {{FieldName}}.

How it works

  1. Each row triggers its own API request
  2. {{FieldName}} variables are replaced with values from that row
  3. The same row gets updated with the API response, based on your field-mapping settings

How to set it up

For example, if you'd like to use variables to update your database based on ticker symbols in your database, here's how you could do it.

Let's say you have a Notion database that looks like this:

SymbolPrice
AAPL
META
GOOG
  1. Go to your dashboard and create a new request
  2. Select a Notion account and database to connect to
  3. In the request options step, you can add a variable anywhere in the URL, params, headers, and body by:
  • clicking and selecting the Notion field from the dropdown
  • or manually typing the variable
  1. In this example, we could use the ticker symbol in the API request by updating the URL to https://financialmodelingprep.com/api/v3/quote/{{Symbol}}
  • this means that this API request will run once for each row in your database, replacing the {{Symbol}} with the value in your database, e.g.
    • https://financialmodelingprep.com/api/v3/quote/AAPL
    • https://financialmodelingprep.com/api/v3/quote/META
    • https://financialmodelingprep.com/api/v3/quote/GOOG
  1. In the map database fields step, map the Price source field to the Price Notion field.
  2. In the output options step, choose the run for each row request type.
  3. And that's it! Now you can run or schedule the request.

Best practices

  • Ensure {{FieldName}} exactly matches your Notion field name (case sensitive).
  • Before running a request on a large database, ensure that your settings work by testing in a smaller database with sample fields