Hello guys,
Please help me why I can’t to substring my variable after using For Each Row Data Scrapping.
So I have a variable named ValidTo from the result of data scrapping. It contains date from SAP and I want to take the number of date, month, and year so I can compare it to make some logic for my project. I’m using substring to take the number of date, month, and year after using For Each Row, then I’m running the program to check the result after using substring and I found this error.
I also try using split first before, but it has same result. I checked my result of data scrapping and it works. The ValidTo variable contains the information I need but the format still 21.12.2019 (example).
I use assign and create new variable named Year then use ValidTo.ToString.Substring(6, 4). I check the data using message box after the substring but it doesn’t work. I read many application of substring and try it. The result is good but in that case they don’t use For Each Row first just using input dialog. Is my problem comes from using the For Each Row first or because I have a wrong programming process ?
I hope someone can help me to solve this problem because I’m newbie here and I’m waiting for the good news from you all. Thank you
create 3 different variables
DateVar string
MonthVar string
YearVar string
Now use assign activity
Assign
Datevar = Mainstr.split(“.”.tochararray)(0)
Use another assign
Assign
MonthVar = Mainstr.split(“.”.tochararray)(1)
Use one more assign activity
Assign
YearVar = Mainstr.split(“.”.tochararray)(2)