I think I need to explicitly define this field as an array, and change the workflow expression. I’m unclear on exactly how should I properly format and send this data to avoid the JSON error?
This will create an error for sure as you are encoding a list of text, each item, as json safe and not the whole thing. So you will have something like "medication_source":"texta","textb","textc" … that is not a valid json. But to be able to help you, we need to know what the API expect… an array of string? in this case, you just need to add square brackets around it "medication_source":["texta","textb","textc"] but if you need something different, you may need to use :format as text instead.
Here is the data from the last error. The issue is with “desired_outcome_meditation”. I tried adding Json safe to the entire thing but that obviously didn’t fix it. What do I change the expression to?
How do I check or modify the API’s expected input? Doesn’t the screenshot I sent in my original message, showing the API body from the connector, indicate that?
What the output expected by the API? any example? link to api doc? Actually, adding another formatted as json-safe probably set things wrong (but could have worked if the API expected a string). This is not what I believe and probably expect an array like I’ve suggested in my previous post.
What did you sent when you initialized the call in API Connector?
It doesn’t help. Without knowing what the API expect (array, string, object…) I cannot tell you exactly what you need to do.
Could be easy as adding [ square bracket] around (if the api expect an array of string) or more complex to use :format as text on the list or this could be :join with , and :format as json-safe if this expect a string.
So my question is what did you provide in API Connector for this field when you initialized it? Or API Doc that can show what API expect there…