From what I understand, you are sending the JSON to API workflow? Using api connector? How did you set your backend WF? Can you share the whole json sent? API Connector settings? Action that encode the JSON?
Also, the encoding seem wrong to me because the options are in a string instead of array of string…
Can you provide the full json sent (put them between ``` quotes so we can read it correctly in forum) and how did you set the API endpoint in backend workflow? using detect data? manually entered values?
I did a test on my side an didn’t get any issue. What I suggest is:
A) Detect your payload again in API workflow (send the same request from pastebin using postman for example). Check field mapping after that.
B) Validate the json sent from API connector using a requestbin.com (or similar tool) to check if the json have the same structue when sent. Also, be sure to validate content-type header.
Are you sending the request after to another workflow (schedule on a list)? If yes, please share what you have set for this workflow
Thanks @Jici - detecting the data using the JSON I put into Pastebin has resolved the original issue, but it’s unfortunately created a new one with the “lists”.
For example:
“Colours”:“["Black", "White", "Red"]”
In the debug record, it shows exactly the same as it did before I did the new “detect data”, but the workflow produced errors and wouldn’t accept what I’d previously done:
I literally just copied and pasted the JSON from pastebin - clearly I’m missing something but don’t know what.
Edit: It’s actually all the lists that are now having an issue.
The payload I got from your pastebin was a string for colours
"Colours": "[\"Black\", \"White\", \"Red\"]",
You can see that the array is escaped and encoded into double quotes. This mean this is a string, not an array of colours.
More than that, when there’s only one colours, this is returned as a string value without any square brackets. This could cause issue if this was in JSON. So better to keep it as string and use regex or find and replace with split by like you do.
The T1 uploader instructs me to format the fields inside the CSV as a JSON array, which is what I’ve done - I’m guessing that’s why it’s doing this?
Should I just put them in separated by commas - it would actually be better if I don’t have to do this, as it makes it more difficult for customers to format the file properly.
I don’t know how T1 work so it’s hard for me to help about formatting this correctly. The best would be to always return an array of string like you have in your screenshot, but I guess this may be something not handled by T1.