cancel
Showing results for 
Search instead for 
Did you mean: 

Nested for loop with multi-level collection

Raiaan
Explorer
0 Kudos

What is the code/target for the "Get Element" activity in the example found here?

Accepted Solutions (1)

Accepted Solutions (1)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert

vishalrathi21

Please refer to the openSAPCourse Unit 3 :Additional Design features where we have explained about it.

You can refer to the sample bot on the same.

Answers (1)

Answers (1)

vishal
Contributor
0 Kudos

Hi 0023727220,

The automation workflow example in link you shared basically we see there are two For Each loops.

  • The first For Each loop (step 1) is to browse through row by row in the table
  • The second For Each loop (step 2) is to browse through each cell in particular row

Since the “Get Element” (step 3) is positioned within the second For Each loop, it would return the text from each cell.

Now to understand code/target selection criteria, can refer to this link where a use case is explained. Suggest you check this in detail..

There wont be need to write complex code, just go to drop down of Target (in Get Element) and select from drop down.

In addition for further clarity - if you just want to print the cell value returned in second For each loop, can also add a “Log Message” activity (just before “Get Element”) with message value something like Step1.currentMember + " : " + Step2.currentMember . Please tweak this and test out until you get desired results. All the best!

Regards,

Vishal Rathi

Raiaan
Explorer
0 Kudos

I have 2 collections - Rows and Cells

Step1 - Outer For each loop iterating through the rows

Step2 - Inner For each loop iterating through the cells, however I am unable to get access to the index and set it for the looping list similar to what is shown in step 5 in the link you shared. How can I resolve this?

Step3 - Get Element on Step2.currentMember