Best answer

Update row in postgres with JSONB data

  • 7 September 2023
  • 7 replies
  • 159 views

We have a postgres table with a JSONB column we’d like to update. We’re using ‘Update row in PostgreSQL”, however, when we specify a value, such as:

`{“key”: “Value”}`

 

..it inputs it into our db with escape characters that render the JSON invalid. We have also tried single quotes and other formatting, but are unable to find a consistent format that works. 

 

How can we format a jsonb value?

icon

Best answer by shalgrim 8 September 2023, 00:14

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

7 replies

Userlevel 7
Badge +14

Hi @amplicity 

Good question.

Can you post screenshots with how your Zap steps are configured along with a specific example so we can have more context?

Def. See attached, let me know if that’s not clear.

 

 

 

Userlevel 7
Badge +14

@amplicity 

Have you tried removing the leading and trailing ‘ ?

Also, the values look to have JSON brackets {}, which may be impacting the JSON structure.

 

> Have you tried removing the leading and trailing ‘ ?

Yes, without ` ’ `, zapier automatically puts ` ” ` around the entire content, along with `\` escape characters for the quotes.

 

> Also, the values look to have JSON brackets {}, which may be impacting the JSON structure.

Correct, this is expected because we include query params. These are in the correct JSON structure and work within our application as expected.

 

 

Configuration
Postgres column after update

 

 

 

Userlevel 7
Badge +14

@amplicity 

If you suspect there is an issue with the Zap action, you can try opening a ticket with Zapier Support: https://zapier.com/app/get-help

Userlevel 6
Badge +8

@amplicity 

This integration doesn’t support jsonb.

We have an open feature request to support this, and I’ve gone ahead and logged your email as a vote for that feature. I don't have an ETA on when that might happen, we get so many feature requests every day, but we do use these lists when we're working on app updates.

As we have your email logged as a vote there, we will be sure to drop you an email to let you know as soon as we get any news on that front.

I’m sorry I don’t have a better answer for you here.

Thanks for the info, we’ll have to find another workaround for now!