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?
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
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:
(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()
Find starter help here:
LINQ-PartialMatchLookup.xaml (7.3 KB)
Hi!Gokul001
Thanks for the comment!
You taught me very kindly, but I didn’t understand you well enough.
Sorry.
I’ll learn more so I can understand the code you’re talking about!
Help me again if I’m having trouble!
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!
Please help me again if I’m ever in trouble.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.