UseCase: We will upload a CSV file as attachment to REST API and then parse the CSV file and send back the contents as json back to the consumer.
Highlevel steps:
- Configure a rest trigger with POST verb and select request as multipart with payload options and response as a json payload
- Take a stage and write the file into stage using opaque schema and encodeReferenceToBase64() function.
- Take another stage and read the file using sample deilimited doc.
- Map the read contents to rest response.
Json response payload:
[{
"FirstName":"",
"LastName":"",
"Designation":""
}]
For opaque schema:
https://soalicious.blogspot.com/2022/02/xsd-opaque-schema.html
Detailed implementation steps:
Integration flow:
No comments:
Post a Comment