04-29-2025 06:29 PM
Hi there,
I am pulling data from Coupa to store it in json files. its coming in below format. I need to create a JSON file for each record and store it into sftp server with id as file name.
input
[
{
"statusLine": {
"protoVersion": "HTTP/1.1",
"statusCode": 200,
"reasonPhrase": "OK"
},
"entity": [
{
"id": 41728,
"created-at": "2025-04-29T15:26:38-07:00",
"updated-at": "2025-04-29T15:35:14-07:00",
"po-number": "4501939775"
}
],
"headers": {
"strict-transport-security": "max-age=31536000; includeSubDomains;",
"x-content-type-options": "nosniff",
"vary": "Accept",
"x-runtime": "0.692075"
}
}
]
heres my pipeline with one record.
after my union, i get following
[
{
"fileName": "41728"
},
[
{
"id": 41728,
"created-at": "2025-04-29T15:26:38-07:00",
"updated-at": "2025-04-29T15:35:14-07:00",
"po-number": "4501939775"
}
]
]
what I am trying to do is use the id and storing it in filename so I can use that for the file name. but in fact what i want in the file is just below.
{
"id": 41728,
"created-at": "2025-04-29T15:26:38-07:00",
"updated-at": "2025-04-29T15:35:14-07:00",
"po-number": "4501939775"
}
how can I achieve that? also how can I get the Id to be the filename.json like in below example, 41728.json
Thanks
Manohar
Solved! Go to Solution.
05-09-2025 02:40 AM - edited 05-09-2025 02:41 AM
Simpler Alternative
If you only need the document ID as the filename, you can set the Binary Header property in the JSON Formatter snap to the ID field.
I’ve attached a sample pipeline that shows the settings in action.
Hope it helps—let me know if any part isn’t clear!
04-30-2025 01:21 AM
Please find the attached 2 pipelines.
Parent pipeline will extract the source data, will pass to the child, and the child pipeline will write the file with the Id in the filename.
BR,
Spiro
05-09-2025 02:40 AM - edited 05-09-2025 02:41 AM
Simpler Alternative
If you only need the document ID as the filename, you can set the Binary Header property in the JSON Formatter snap to the ID field.
I’ve attached a sample pipeline that shows the settings in action.
Hope it helps—let me know if any part isn’t clear!