I have a 2 string variable value, please find the screenshot table, I need to get the Amount column value ,Once found those 2 variable value in the table
e.g. StrVariable1 = “GHL /SDF”
StrVariable2 = “bb”
I need to find StrVariable1 in the table, once that value matched, Need to find the
StrVariable2 in that table. Once StrVariable2 value has been matched i need to take the value from Amount column (i.e) 30
likewise in the next loop, i will be having the 2 variable value & Again i need to get amount column value once matched with other 2 variable value.
An approach would be to save somewhere the strings that you are looking for, preferably in a dictionary where the key would be String1 and the value String 2 (e.g. {“GHL/SDF”,“bb”}).
Now you can iterate through the dictionary items and have something like this:
For each Dictionary item:
elementFound = false
For each row in table:
if (CurrentRow("Name")=CurrentKey)
save current row index
elementFound = true
break
if (elementFound = true)
For each row in table: //the search will start from last index found so we skip redundant iterations
if(currentRow("Name") = Dictionary(Key))
get the value from column amount
//do whatever else you want
break
Let me know if you need more clarification on this!
Use the If condition RowindexLookup.Equals(-1) if the string is not present in the Dt it will go to Then part. If its present it will go to Else part
In Else part again use the lookup data table activity
Mention all required fields and create the output of cellvalue and Mention the Target column 2 means it is Amount column value it will give
Note: cellvalue output variable type is System.object