Hi all,
I’m currently creating an automation connected to an API. The output should be a datatable which would be used in a later stage. However, as I understand it, the datatable format is not readable for the API answer.
The way that I currently constructed automation in Studio is that I’ve put every value of the columns as an array of strings, see the following:
This gives the output to the API in the following format (in postman):
“OutputArguments”:
“{"Description":["DA","DB","DC","DD"],
"Unit":["UA","UB","UC","UD"],
"Available":["AA","AB","AC","AD"],
"AvailableOn":["yyyy-mm-dd","yyyy-mm-dd","yyyy-mm-dd","yyyy-mm-dd"],
"Product":["PA","PB","PC","PD"],
"Quantity":["Q","Q2","Q3","Q4"],
"ShipFrom":["SA","SB","SC","SD"]}”
However, the API developer that I am having discussions with wants to have the output in the format of array of objects, with each name of the variable included per row. For example:
[ { Description:“DA”, Unit:“UA”, Available: “AA”, AvailableOn:“yyyy-mm-dd”, Product:“PA”, Quantity: “QA”, ShipFrom: “SA” },
{ Description:“DA”, Unit:“UB”, Available: “AB”, AvailableOn:“yyyy-mm-dd”, Product:“PB”, Quantity: “QB”, ShipFrom: “SB” }
{ Description:“DA”, Unit:“UC”, Available: “AC”, AvailableOn:“yyyy-mm-dd”, Product:“PC”, Quantity: “QC”, ShipFrom: “SC” }
{ Description:“DA”, Unit:“UD”, Available: “AD”, AvailableOn:“yyyy-mm-dd”, Product:“PD”, Quantity: “QD”, ShipFrom: “SD” } ]
Does anyone have a good solution for this?
Thanks in advance!