Hi All, hope to get help on this:
I have a DT in excel:
For each same “Order”, I have to enter into this Oracle Java Screen
Which will bring me to all the items under this Order, shown in this window:
Then I Enter the quantity according to my datatable and submit/ save.
Go to the Next Order and repeat Step 2).
I am stuck with how to “iterate” through each Order in sequence. Appreciate any help and guidance.
1 Like
Have you try to work on it? You can use excel apliction scope and use readrange ang forearo to iterate @COOLBOT
4 Likes
Yes, I have used Read range in Excel application scope. But what kind of " flow/logic" to process each Order in sequence?
your problem is somewhat similar to what i am looking as well. I can’t figure out how to “iterate” again after final step
what you mean was you need to sort first the datatable before entering the value in oracle am i correct ? @COOLBOT
cheers
Happy learning
3 Likes
Hi,
Sorting is not the issue because I can either sort in in Excel or in Uipath. I am stuck with how to iterate or the logic flow, treating each Order (with many items) independently and going to the next Order …….
ppr
(Peter Preuss)
October 11, 2019, 8:17am
7
@COOLBOT
Give a try on following
Retrieve the distinct values for Column Order (groups)
Linq statement
Iterate over this groups
for each, for each row
Filter for the group values
Linq, Filter Datatable …
Do the entries for the group items
Hi,
Thank you for outlining the process. As I have no knowledge of Linq, I suppose I would have to explore other methods .
ppr
(Peter Preuss)
October 14, 2019, 9:24am
9
@COOLBOT
Just tell us on which part of implementation you need more help and we will support you on this
Luis261980
(Luis Nunes)
October 14, 2019, 12:44pm
10
hi COOLBOT ,
Try this:
1 - Use Excel Activity + Read Range to make your DT
2 - Use For each row
Next Steps all inside the Use For each row
3 - Assing Order = row(0).tostring → this will give you 1st order
4 - Assing Item = row(2).tostring → this will give you 1st Item
5 - Assing LINE_NUM = row(1).tostring → this will give you 1st LINE_NUM
6 - Assing Received_City = row(3).tostring → this will give you 1st Received_City
Now you have all information stored in strings and ready to work
Use type into and use your strings make sure all are in same scope
For Each row will encrement all you rows in data table alone
ppr
(Peter Preuss)
October 14, 2019, 9:05pm
11
@COOLBOT
Just a little starter help:
Readin the Excel into a DataTable - Read Range
e.g. Variablename: dtData - Assumption Column Order is of DataType: Int32
Creating a list of Groups (Distinct Orders) - Assign Activity
DataType Orders: List(Of Int32)
Statement: dtDemo.AsEnumerable.Select(Function (row) row.Field(Of Int32)(“Order”)).Distinct().ToList
Iterate over the Groups
Filter the original DataTable to all Rows belonging to the Current Group from Iteration - dtFiltered
Iterate over all Rows from dtFiltered
do your processing e.g. Entering the Data (In Screenshot show cased with a Log Message)
bcorrea
(Bruno Correa)
October 14, 2019, 9:16pm
12
Create a variable to store OrderNumber = 0
For Each
If OrderNumber = 0 OR OrderNumber <> Row("OrderNumber)
→ This is new Order
Else
→ Already opened window must just do details part
COOLBOT
October 15, 2019, 7:52am
13
Hi ppr,
Thank you for helping me start it off. While I am beginning to understand the logical flow,
I am still facing a compilation error which I could not solve. Appreciate any guidance and advice.
RPA_1.xaml (11.5 KB)
ppr
(Peter Preuss)
October 15, 2019, 8:12am
14
@COOLBOT
the issue comes from following:
Datatype of your Variable Order is Int32 but should be as written above: List(Of Int32)
Boaepa
October 15, 2019, 9:40am
15
Hi @bcorrea and @COOLBOT ,
This is what I was thinking too. No need to use LINQ if your Table is sorted.
Use a “While” to loop over all the rows and check at the end of the while’s body if the next row is a new “Order” or the end of the table.