I have a problem with this activity in UiPath. I manage to insert the first orders from my Excel example into SAP very well.
I have used an If/Else condition for this.
NOT String.IsNullOrEmpty(CurrentRow.ByField(“Client”)) The order is then created here with the first article.
In the Else branch, String.IsNullOrEmpty(CurrentRow.ByField(“Client”)) is then used. AND NOT String.IsNullOrEmpty(CurrentRow.ByField(“Material”))
here it then enters the second item from the order.
However, this only works for me with orders with two items. At the end of my sample data in Excel, I still have an order with one item and an order with three items. However, it does not execute them correctly.
Does anyone have any idea how I can solve this? Can I add an If/else after this or is there a simpler solution?
Hello @Matthias_Kuntz
It is due the Empty row behavior Property has stop in For Each row excl Activity. There is Completely empty row in your File after 129997. So it stops. To avoid this use Stop after 3 consecuyive empty rows Property. Orelse use required one.
you used it in the else condition by default but when the item is only one the submit is to be clicked after first row only…in case of 3…the submit is to be click after the 3rd and not second
so to make it generic use the click outside both the condition, at the start of the process…and use the if condition liek this …in the for loop first add a index variable to the index property and then in the condition use Not index=0 AndAlso Not String.IsNullOrEmpty(currentRow("Client").ToString)
Make sure this is the first activity in for loop
also to click the last submit use a submit click outsude the loop also which will click submit for the last item as well
In for each excel row properties only we have an index property available…it gets auto incremented also…and for making it work for any number one more if condition to be added
You can use currentindex to get that index value instead of using a index variable and initiaizing with 0 and then incrementing it
this is how it looks…after this you can add your other conditions as is
Thank you very much for your help. It still doesn’t work the way I want it to, but these are probably some other errors now. I think I will get it to work in a similar way. But thanks for your help.