I’m a beginner in RPA, I just made some easy robots, but now I have to do something for my work and I just don’t get it.
I have to get values from some rows and then print them on the excel. So I have something like this
for each row in table1
get variableX
for each line table2
get variable Y
IF variable X = Variable Y
store VariableZ somewhere (i dont know if a list or an array)
but the thing is that there are going to be multiple matches, so variableX can match 3 times variableY and I have to print those 3 variableZ values in one cell.
I don’t know if I explain myself
Thanks for reading.
As per my understanding on the requirement your mentioned your post I am sharing my suggestion as below. I think we have to go for nested for each row table.
Create one string array stringarr with arraytype.
Use For each row table activity assign your First data table (assume FirstDT)
To get the VariableX= Current Row(“YourColumnNametable1”).tostring
Use another For each row table activity inside first for each and assign your second datatable (assume SecondDT)
To get variableY = CurrentRow(“Yourcolumnnameintable2”).tostring
Inside this second for each loop use one if condition and add your expression like
I put what you said about the collection but it says the property collection of add to collection is not initialized, I search about it but I saw an example with a list
New System.Collection.Generic.List(Of String)
And I see theres no .Array, do you know how do I initialize this?
And excuse me, do you know how can I print the collection in a single excel cell?
For example the 3 matches of VariableZ needs to appear in one cell like “one two three”
I couldnt upload the excel but I put the images of the tables, the one called “hoja2” has the result that I get, It prints just the last match instead of 123 in apple.
Maybe my mistake it’s too visible but… I can’t get it Im sorry.
I have modified few changes in your flow and i also attached the output with this I it is writing the matched values in a single cell , Have a look at Matched sheet (“output sheet”)
hope its solves your issue
Update us whether you a desired solution or not Libro2.xlsx (10.5 KB) Main (4).xaml (15.5 KB)
I see, it’s something like that but my desired values are the ones that will print in the column “responsable” in my “Hoja2”, in the photos I put for example, in apple it only store the number 3, when I want:
apple 123
blue 9
star 8
and the other ones should stay where they are
I don’t know if I explain. But I will try to do it with what I saw on your flow, thank you!