Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Convert CSV to XML

Not applicable

Hi,

Is there any policy in Apigee or any other way through which I can convert CSV to XML based on a query parameter like format=csv or format=xml??

Solved Solved
0 2 2,898
1 ACCEPTED SOLUTION

Dear @apigee1234567 ,

Unfortunately, there is NO ready to use policy which does CSV to XML. But, You can leverage Node.js modules to manage these types of transformations. Please find module which does same,

1. CSV to JSON - https://www.npmjs.com/package/csv-to-json , use JSON to XML to get XML after this particular flow.

You might need to use another external service which does CSV to JSON using node.js module mentioned above, In your proxy use Service Callout Policy and JSON to XML to convert from CSV to XML.

Please find sample Apigee API proxy that converts CSV file to XML & access result using an API.

csvtojson-rev1-2016-11-11.zip

View solution in original post

2 REPLIES 2