Partial match by searching data table

I’m looking for a way to do a partial match with “Search in Data Table”.
I want to search for the part of the search character “AAA” with “* AAA *”.
Does anyone have a good idea? :thinking: :thinking:
Or if there is another way that works, please let me know.

HI @ri-na

I think we can’t pass a string with wildcards in Lookup datatable it should be either complete word directly or by assigning it to any variable.

Can you try this way
Use for each row in datatable and loop through all the column

  • If Row(“Column2”).tostring.contains(“AAA”)
    • Look up value and pass the whole string as value Row(“Column2”).tostring and get youe index and cell value

Regards
Gokul

2 Likes

As a wildcard concept is not supported by the lookup datatable activity we would handle it like a filtering action

in case you are interested on value and row index we can do with a LINQ:
grafik

(From i In Enumerable.Range(0, dtData.Rows.Count)
Let r = dtData.Rows(i)
Where r(0).toString.Contains(searchTerm)
Select t = Tuple.Create(r(1).toString, i)).DefaultIfEmpty(Tuple.Create("NOT-FOUND", -1)).First()

grafik

Find starter help here:
LINQ-PartialMatchLookup.xaml (7.3 KB)

2 Likes

Hi!Gokul001

Thanks for the comment!

You taught me very kindly, but I didn’t understand you well enough. :sob: :sob:
Sorry.

I’ll learn more so I can understand the code you’re talking about!

Help me again if I’m having trouble! :smiling_face_with_three_hearts:

1 Like

Hi! ppr

Wow!
All my problems are solved!
Thank you!

I’m new to uipath and didn’t know what you were talking about, but I changed the data you provided and it all worked out!
Thanks for going out of your way to get that data for me! :grin: :grin:

Please help me again if I’m ever in trouble. :heart:

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