0
votes

I have a situation where i need to read a file (XLS) which is attached in an record using the Mulesoft. I have to apply some validations like file should not have more than 10 columns, if not it would through error message back to user.

My question is how to read excel file using Mulesoft. As we have so many records for which file is attached, I need to create a setup so that Mulesoft could read file for each record dynamically.

Please help.

Regards, Pankaj

1

1 Answers

0
votes

Mule provides the expression and transformation language DataWeave, which can read and transform Excel files dynamically. See an example at https://docs.mulesoft.com/mule-runtime/4.2/dataweave-cookbook-xlsx-lookup.

You could use DataWeave functions to count the number of attributes of the first row to see if it is greater than 10.

You can use the validation module to check if the result of the condition is true or throw the error.