I’m trying to get a simple insert statement for postgres to work, and get an error. What am I doing wrong here?
First off, welcome to the Pipedream community. Happy to have you!
Thanks for sharing the screenshot, much easier to follow along. I noticed in the Inputs tab that there is actually one computed string, instead of two.
When you open the Values prop dropdown, did you enter in a custom expression that defines one row?
I entered only what you see there. What should the values look like?
I believe the issue is that you may have entered in both values in the same row.
Please try opening the Values prop and see if there is only one row, and then you can use the plus icon to add another row and move your second entry to it:
yes, there’s only one row because I’m trying to pass in all of the columns for that row as a set of values. So, insert into the table using VALUES(xx,xx) which works in SQL form. Can I do that here?
That’s correct, this action inserts one single row.
However, the Values property is an array of values. If you pass two strings to one value entry, only one value is defined.
Your query is expecting two values.
So either you can use the plus icon to and define the second value, as shown in the screenshot below:
Or alternatively use the Enter a custom expression option and make sure to wrap your expression in parantheses to make sure it’s treated as an array and not a single value:
ahh… Thanks. I’m not getting that choice to pick out an individual value. It’s just showing as a string. I tried different tests, but can’t seem to figure it out. What exactly does the body need to look like so that the values can be parsed?
Make sure you click the
select path option when hovering over data in the dropdown.
Here’s a short video from our University series to show you how to use the step exports explorer:
yes, I did. Take a look here and you’ll see that it’s one line:
Thanks for the screenshot, that’s very helpful @glen1 .
I recommend adding a Node.js code step in between the trigger and the Postgres step, simply to parse the JSON from the
go it ok. The call is originating at my code, so I can change it. Just wondering if there was a better format to send it in… I guess JSON, without stringify is the answer…
thanks for all of your help