Solved

What is the best way to iterate through a data file (CSV)?

  • 30 August 2023
  • 3 replies
  • 299 views

Userlevel 4
Badge +10

We’re still in the process of migrating from Nintex RPA LE to Nintex RPA, and one of the features we’re severely missing is how easy RPA LE handled the import of data. With RPA LE, you could have it import a data file (like a CSV), and it would automatically populate a “Data” section with all of the available headers in the file.  You could then loop through that data, and easily reference a property from the current iteration. 

 

With Nintex RPA, this process seems MUCH more cumbersome. It seems like you need to import the file as text into a variable, then iterate through that variable with a specified row delimiter. To pull out a specific property of the current row, you need to get that index of the needed column using a column delimiter, and hope the layout of the file doesn’t change. I know that I could set it up at the beginning of the loop to pull out each index of the row into a named property - it’s just a lot of work that we didn’t have to do with the legacy product. 

 

So, for those that iterate through a set of data with a semi-large amount of fields - Do you have an efficient and easy way reference the necessary properties for each row?

 

Thank you!

icon

Best answer by gobitz 30 August 2023, 21:34

View original

3 replies

Userlevel 1
Badge +6

hello

yes, in Nintex RPA you save all the data as a string and then usually take a row and split that up into columns - either by using the get array command or split command.

There are table lookup commands if you prefer to look for a header and then get the column with the data beneath it (in case the file changes).

Hope that helps.

Userlevel 4
Badge +10

Thanks for the response @gobitz 

 

Using the Table Lookup action does seem to be much less work than the method I was anticipating to use.  It does require an action for each property we want to pull out, but it avoids having to reference a specific column index that may change.

 

Now if only I was able to use a variable in the Output Variable field to dynamically create a variable instead of hardcoding its name.  Then I wouldn’t need an action for each property, as I could just iterate through each header in row 1, and pull out each value in the current row and save it to a variable whose name is the current header…. If that was possible, I could even make it a global function which would make it VERY easy to do and HIGHLY reusable…. if only.

Badge +3

We are also transitioning from RPA LE to RPA.  I’m planning to get around the parsing issue by working with our DBAs to create SQL tables for the various processes.  Each record will have a column called “RPA Status” with the value set as NULL.  Within your script/flow you would have a SQL Query they would pull in the first record where RPAStatus = NULL.  When you finish working that record, you write back to that record and mark the RPAStatus as “Complete”. Loop through until there are no more records where RPAStatus = NULL.

This is also helpful if you have to start over or there is some type of network disruption.  The records that are completed are already marked as complete.

Reply