cancel
Showing results for 
Search instead for 
Did you mean: 

JSON Parser output to CSV file

victor
Deputy Chef I
Deputy Chef I

Hello there,

I am getting a response from an API then I passed it through the JSON Parser and it got something as below. You will see that I have items/product that I would like to have in separated rows in a CSV file. I tried with a FOR EACH loop using products array, but it does not iterate, the input is empty, but I am taking the datapill from the JSON parser, what am I missing?

Thanks

 

{
"document": {
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Product Claim Details",
"type": "object",
"properties": {
"products": {
"type": "array",
"items": [
{
"Vendor": "CANADA",
"BillingDate": "2022/09/02",
"InvoiceNumber": "SL1",
"productNumber": "14-1",
"description": "MUG SET",
"status": "FD",
"vendorPartNumber": "MUGCAN",
"units": 0,
"claimAmounts": 0,
"initialBillingAvailable": 0.14,
"shortfallSurplus": -0.14
},
{
"Vendor": "CANADA",
"BillingDate": "2022/09/02",
"InvoiceNumber": "SL2",
"productNumber": "14-2",
"description": "BOWL",
"status": "FD",
"vendorPartNumber": "29CN",
"units": 0,
"claimAmounts": 0,
"initialBillingAvailable": 2.25,
"shortfallSurplus": -2.25
}
]
}
},
"required": [
"products"
]
}
}

 

1 ACCEPTED SOLUTION

gary1
Executive Chef II
Executive Chef II

I took another look and this is very interesting! I can't get the example you provided to work in the JSON parser as is. 

I have to remove this line:

"required": ["products"]

I guess the one-dimensional array is throwing off the parser. 

Once this is removed, I can access the items data pill without a problem.

Give this a shot, hopefully it will work. 

View solution in original post

5 REPLIES 5

gary1
Executive Chef II
Executive Chef II

Can you send some screenshots of your recipe? Something must be misconfigured. Let's figure it out.