i Keep getting an error message which is driving me crazy. Please find attached the screenshot of my workflow. I would like to extrat certain data from an excel file via the get row item. I am using the get row item because i need to get information from the 6th collum. Everything seems to be working fine. However, when i run the process i get the following error. It does however work correctly when i try using a message box i get the correct value shown to me. Can someone pls assisst?
I found the error (some values in the excel file have less digits than others. Do you have any idea how i fix this with an IF function (some contain 12 digits and other 14)?
I have an additional question. When i try to use the get row item and the assign function i get the error when the information in the table in excel stops (most likely because is selected the 6th collum index and it trys to assign something to a a cell with no value. How do i fix this?
Your Assign activity is throwing an error: Index was out of range. If you see here, you will find out that it is the issue with the .SubString method:
The regex solution will work better, because it will simply find your value or return empty string (without an error).
The Get Row activity is working as it should - it returns your value from 6th column of the table (and can return an empty string if there is no value in that row).
Could you please provide me with a sample of the regex (as i am new to UIPATH). the total aanslagnummer looks something like this 215370261H3601. With the BSN i just want to extract the first 9 digits. How do i do this with regex?
Try this in an Assign activity: BSN = System.Text.RegularExpressions.Regex.Match(aanslagnummer,"^\d{9}").ToString
and see how the expression works here: regex101: build, test, and debug regex
It will extract 9 digits starting at the beginning of your string