Hello, searched on the forum and couldn’t a good topic/old post for my question.
I’m using a postman flow to collect data from our reporting system to monday.
I got it to work just fine.
My question is there another way to format create item column fields?
Doing it now needing to escape all " makes it hard to read and maintain.
Lucky I have only 5 columns to handla but if it comes up to 10+ columns it’s going to be hard to read and maintain.
Just use a regular object and use your languages facilities to convert to JSON. Why make this hard on yourself doing it by hand??? Here is a Javascript example
const values = JSON.stringify({
text: companyName //these variables used as values come from your code elsewhere
text2: projectName
time: timeString
date_1: dateString
})
Then just use the “values” string (which is JSON) as a GraphQL variable.
Now you don’t have to worry about escaping or quoting JSON right. create JSON using your language and then use that JSON string as a variable. This also solved all the mess you get when a value includes quotes and you can’t control if it does or not.
Stop substituting into the query string (that is all the query is, a string). There is zero need to put yourself through that misery. Create your JSON as actual JSON in code, then use a variable to use it in the mutation.
The script didn’t work as pre-request script in postman, I guess I could tested some more with that but I tried this but it didn’t work. It looks about the same. It creates a array
You’re going to be only developing for postman? I expected you’re developing code that will run regularly and had access to a full javascript environment you were programming within (UI app feature, or node.js backend, or some other backend in another language.) and were just using postman for testing your queries.
I know a bit about postman’s pre-execution scripting but I haven’t built any of this in it before.
Built a POC in postman for a integration between our reporting system and Monday.
I got it working. Just that create item was a bit of hassle to setup.