Parsed Excel only creates one row in Scoped App

gjz
Mega Sage

I've created a custom scoped app and I am parsing an Excel spreadsheet into a scoped table from a flow action.  Everything is working fine, except it will only create one row in the table and not the rest in the spreadsheet.  When I run the same code in a fix script, all rows are created in the table.  Can anyone spot why it isn't working?

 

In my test spreadsheet, I have a header row and three data rows.

 

The action has two inputs, attachmentSysId and remediationEffort, which is a reference to the record with the attachment.

 

This is the script in the action - it will only create the last row in the spreadsheet:

gjz_0-1724695568144.png

This is essentially the same code in a Fix Script that creates all three rows - with the difference highlighted in yellow:

gjz_2-1724695949091.png

 

Can anyone tell me why the action code behaves differently than the Fix Script?  Both were created and run in the scoped app.

 

 

 

3 REPLIES 3

Sandeep Rajput
Tera Patron
Tera Patron

@gjz One of the differences I can spot is that in your fix script you are closing the parser connection on line number 50. Whereas no such line is present in your Action script.

 

Also, would it be possible for you to share both the scripts in textual format along with the excel file sample you are trying. This will help to debug the issue.

@Sandeep Rajput 

You have answered several of my questions that helped me in the past week - I really appreciate it.  In this case, I did just find the issue - I am missing the opening bracket in the while statement

 

while (parser.next()) {
 
Once I added that I got all three rows.
 
Thanks again for answering promptly, it's much appreciated!
 

@gjz Glad to know that you found the fix.