Response JMESPath
Last updated
Last updated
Transform your API responses with JMESPath, a powerful query language that helps you extract and reshape JSON data before it reaches Airtable. Use JMESPath to keep only the fields you need, rename confusing field names, filter data based on conditions, and work with nested structures.
On the request screen, click the Advanced Settings button to expand additional options.
Scroll down to the Response JMESPath field and enter your expression.
Run your request again to see the transformed data, then reconfigure your response field mappings to match the new JSON structure.
Note: These settings are also available on the .
The examples below show how JMESPath can solve common data transformation challenges. In each case, the result is JSON that Data Fetcher can easily map to Airtable fields.
Problem: Your API returns too much data, and you only need a few fields.
Sample JSON:
JMESPath Expression: coins[].{id:id, name:name}
Result: Only the id
and name
fields are kept, reducing clutter in your Airtable base.
Problem: API field names don't match what you want to use in Airtable.
JMESPath Expression: coins[].{price:current_price}
Result: The current_price
field becomes price
, making it easier to understand.
How it works: In JMESPath, use new_name:old_name
syntax inside curly braces to rename fields.
Problem: You only want records that meet specific criteria.
Use conditions with a question mark ?
followed by operators to filter your data:
==
countries[?code == 'GB']
Keep objects where code equals GB
>
coins[?price > `100`]
Keep objects where price is greater than 100
>=
coins[?price >= `100`]
Keep objects where price is greater than or equal to 100
<
coins[?price < `100`]
Keep objects where price is less than 100
<=
coins[?price <= `100`]
Keep objects where price is less than or equal to 100
||
countries[?code == 'GB' || code == 'BR']
Keep objects where code is GB OR BR
&&
coins[?price > `100` && price < `1000`]
Keep objects where price is between 100 and 1000
Example: To keep only coins worth more than $100, use: coins[?current_price > `100`]
Problem: The data you need is buried inside nested objects or arrays.
Sample JSON with nested structure:
JMESPath Expression: coins[].{id:id, price:stats.current_price}
Result: The nested current_price
becomes a top-level price
field.
How it works: Use dot notation (stats.current_price
) to access nested object properties.
Problem: Your JSON has multiple arrays, but Data Fetcher is using the wrong one.
Sample JSON:
Solution: Use exchanges[]
to tell Data Fetcher to create records from the exchanges array instead of the coins array.
Result: The exchanges
array is kept and becomes a top-level array.
Arrays: Access with array_name[]
Objects: Access with object_name.field_name
Conditions: Use [?condition]
to filter arrays
Field selection: Use {new_name:old_name}
to pick and rename fields
Combine techniques: Chain operations like coins[?price > \
100`].{id:id, price:current_price}`
After applying a JMESPath expression, the Response field mapping will automatically refresh next time you run the request.