I have a custom application with a search module that is calling a 3rd party API that returns an array of arrays in a JSON structure. The return looks like:
I would like output that generates a bundle for each Record 1, Record 2, etc. In my communication structure, I have response structure and I’ve tried about every combination of “output” and “iterate” directives. I thought it would be as simple as
"output": "{{item}}"
"iterate": "{{body.Data}}"
but instead, I get a bunch of errors and strings ‘Record 1’, ‘52’, ‘32’, ‘Record 2’ etc with each field as bundles. I have no idea why. It’s almost like the iterator is flattening the array. Any idea on how to get a bundle for each Record row?
Hello - thanks - I get that they’re arrays and not collections, but what is the right way to output in the communication so that each sub array is its own bundle? When I send the output as “output”: {{body.Data}}, I end up with error “expected object but found array”. The upstream API I’m communicating with is 3rd party that I can’t influence.
The errors are probably because the JSON you provided is not valid. Property names (like Data) must be enclosed in double quotes, and arrays should be defined using proper syntax. Here’s possibly the corrected JSON format:
If your version is actually the way you get the data, you will first have to process the data to a point that the JSON is valid and processable by Make. In that case I think custom IML would be your second best bet. First one would be to give the developer a coupon for a free “How to write JSON” course (just joking ).
system
This topic was automatically closed because it's resolved or inactive. Please, start a new topic.
5
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.