Forum Discussion
Hello neelamanikandan,
You can use the sl.ensureArray() function to ensure that the FeeReductionDetail field will always be an array.
Just place a Mapper before the Splitter with the following settings:
Expression: sl.ensureArray($FeeReduction.FeeReductionDetail)
Target Path: $FeeReduction.FeeReductionDetail
With Pass through turned on.
Let me know if this helps you.
Regards,
Aleksandar.
A FileReader snap that reads Excel from a URL. A Binary Router which splits the Output as shown below might work
Hi, if this is a google spreadsheet then consider using Spreadsheet Browser (that lists all the spreadsheets along with their worksheets as per the given filter) snap, followed by the Worksheet Reader (that reads a specific given sheet) snap. Supply values from the browser to the reader snap.
And spreadsheet snappack is a premium snappack. FYI.
- aditya_sharma8 years agoNew Contributor III
If you have little bit of flexibility in implementation, you can split that single excel file with multiple sheets into multiple excel files using few lines of code in Python (Note: Assuming schema is same in each sheet) and then you can just use multi file reader to read the excel files.
I ran into this same problem, and found a solution for my scenario. For this, you’ll need to know the names of the sheets that will be in the workbook, or the maximum number of sheets in the workbook. In my example, I knew the names of all the sheets I would need to read.
This process requires a child pipeline since the excel parser can only use sheet names from parameters and not values passed from an upstream document.My process was:
- Read excel file via REST GET
- Generate list of all sheet names I want to read with a JSON Generator. If using sheet numbers, generate a numeric sequence instead.
- Cross join the file to the list of sheets to read by setting the join condition of 1=1
- Use a pipeline execute to call a child pipeline and pass the sheetname or number as a parameter
- In the child pipeline, read the excel sheet specified by the parameter. If its unknown if the sheet name or number is in that workbook,set your error settings in the parser to ignore errors.
- Jordan12114 years agoNew Contributor
I was able to use this for parsing multiple sheets but it errors if a sheet does not exist. Does anyone know of a way to ignore the specific error for if a sheet is blank and continue processing?
- bojanvelevski4 years agoValued Contributor
@Jordan1211 , try error view
- Jordan12114 years agoNew Contributor
What I did was used the error view plus a router that treated the error I was receiving different than all others. ($error.contains(“Sheet with the provided name does not exist:”)). Which basically classified it as an “Informational Error”. This works for now. I am just wondering if there are other options.
Related Content
- 11 months ago
- 2 years ago
- 3 years ago
- 5 years ago