Skip to main content

Data Transformation

When you import API data into Notion, you often need to transform it first. Note API Connector provides two editors: JMESPath and JSONata. Both can filter and reshape JSON, but they serve slightly different purposes.


JMESPath: Best for Quick Filtering & Selecting​

JMESPath is a query language for JSON. It’s lightweight and great when you want to:

  • Keep only certain fields (e.g. id, name).
  • Rename fields for readability.
  • Filter data based on conditions (price > 50).
  • Extract deeply nested values.
  • Select which array to process when there are multiple.

πŸ“Œ Think of JMESPath as your go-to tool for slicing and dicing JSON quickly. It’s straightforward and works well for simple data shaping.


JSONata: Best for Calculations & Enrichments​

JSONata does everything JMESPath does, plus extra power:

  • πŸ”½ Flatten nested arrays (e.g. orders β†’ line-item rows while keeping order/customer info)
  • πŸ—‚οΈ Spread dynamic key/value fields into columns (e.g. { "key": "plan", "value": "Pro" } β†’ plan: "Pro")
  • 🧹 Normalize inconsistent units or strings (e.g. 1.4 kg vs 173 g)
  • πŸ“… Convert epoch timestamps into ISO date strings for Notion date fields
  • πŸ› οΈ Ensure stable schemas by setting defaults for missing fields
  • πŸ“Š Perform calculations and aggregations (sum, count, average) when needed

πŸ“Œ Think of JSONata as a data transformation toolkit when you need to go beyond filtering.


How to Choose​

  • βœ… Use JMESPath if you just need to pick, rename, or filter fields.
  • βœ… Use JSONata if you need to calculate, transform text, or restructure data.
  • πŸ’‘ Many workflows start with JMESPath for simple filtering and then move to JSONata as needs grow.

Leave a Comment