cancel
Showing results for 
Search instead for 
Did you mean: 

Notion API - Accessing Rich Text Content from Database Query in Create Page Action

dthatcher
Not applicable

I'm building a Workato recipe that queries a Notion database and uses the retrieved content to populate a new Notion page. The Query Database action works and returns the correct JSON data, but I'm unable to access nested rich_text content in the Create Page action.

Current Setup

  • Step 1: Webhook trigger (receives meeting_type from web form)
  • Step 2: Query Database (Notion) - returns 2 records successfully
  • Step 3: IF condition to match user selection
  • Step 4: Create Page (Notion) - fails when trying to access rich_text content

JSON Structure Returned by Query Database

"properties": {
  "AgendaOutline": {
    "id": "oiC%3C",
    "type": "rich_text", 
    "rich_text": [
      {
        "type": "text",
        "text": {
          "content": "1. Wins and Highlights...",
          "link": null
        },
        "plain_text": "1. Wins and Highlights...",
        "href": null
      }
    ]
  }
}

Error Message

400 Bad Request: body.children[2].paragraph.rich_text[0].text.content should be defined, instead was `undefined`

Formulas Attempted

All of these return undefined:

#{steps.step_2['results'][0]['properties']['AgendaOutline']['rich_text'][0]['plain_text']}
#{steps.step_2['results'][0]['properties']['AgendaOutline']['rich_text'][0]['text']['content']}
#{steps.step_2.results[0].properties.AgendaOutline.rich_text[0].plain_text}

Questions

  1. What's the correct syntax to access nested plain_text from Notion rich_text arrays?
  1. Are there known issues with Workato's Notion connector and rich_text data pills?
  1. Should I use a different approach like Custom Actions instead of the standard Create Page action?

Additional Context

  • The Query Database step shows the correct JSON in job history
  • Static text works fine in the Create Page action
  • Data pills for custom properties don't appear in the UI, only in raw JSON

Any help would be greatly appreciated! Has anyone successfully extracted rich_text content from Notion database queries?

 

1 REPLY 1

rajeshjanapati
Deputy Chef III
Deputy Chef III

Hi @dthatcher,

Have you tried implementing with JSON Parser (Json tools by Workato), with that you can able to access rich_text array easily. like shown in the image below. if not, please let me know the exact requirement, will look into it.

parse_json_workaot_community.png

 

Thanks,

J Rajesh Kumar.