Lookup DT - Find word + anyword

Hello! I´m trying to use Lookup Data Table activity with “LookupValue” = “Grand Total” + any word that follows, but “Grand Total” * is not working, how can I achieve this? See example below:

My text in the DT: “Grand Total - Washington to Madrid” --> the "Washington to Madrid part is a variable text, there can be any word there, but "Grand Total - " is always there.
How can I put my Lookup Value to match any of this expressions?

Thank u!!

create a variable with the whole text and use that in the LookupValue property.

Thank you for your response @bcorrea , but how do I express this variable? I mean, I cant put MyVariable = “Grand Total -” *, with * representing any words because it is not a valid expression.

you said “Washington to Madrid” is a variable so in lookupValue you put: “Grand Total - " + variable

ohh sorry, with variable I ment it is not the same in the different DTs I have to look in.
DT1 has “Grand Total - any text1”
DT2 has “Grand Total - any text2”
etc you never know what any text is going to be…

ok, then you need code like this:
table.Select("[Column Name] LIKE 'Grand Total - *'")

I coded this: ExcelRange.Select(" [Column 1] LIKE 'Grand Total - * ’ ")
and I got this error: Compiler error(s) encountered processing expression "“Grand Total - " *”. Expression expected.
Do you know what could it be thats getting me this error?

you need to assign it to a variable of type List(Of DataRow)

Perfect, thank you very much :grinning:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.