I am trying to get a whole string by checking only part of a string

I am trying to see if any rows string partially contain " 4060 " Then assign it to variable projectTASK

The code I am using:
I extract data from a table put it to a local variable table called ExtractDataTable.

I then use a For Each Row in Table
The Data Table is ExtractDataTable
The Item is Table.
I have an if statement in the body that is Table.ToString().Contains(“4060”)
Then
Assign projectTASK (Variable )
Value Table.ToString()

Else Nothing

I stepped through and I see that the table is getting the correct info, but I think that UiPath checks if the entire string contains 4060. I only want it to check if any part of the string contains 4060 then get the entire string.

TIA.

when we want to check in a DataTable if in a particular column in any row a keyyword is contained we can do

Assign activity:
hasFound | Boolean =

dtDataVar.asEnumerable().Any(Function (x) x("YOURCOLNAME").toString.Equals("4060"))

When we have to check all columns and all rows we can do

Assign activity:
hasFound | Boolean =

(From d in dtDataVar.asEnumerable()
Let chk = d.ItemArray.Any(Function (x) x.ToString.Contains("4060"))
Where chk
Select b=chk).Any()

as an alternate for col only check - filter DataTable and check the result count

we do have several options but aligning it out to your modeling start:

IF

CurrentRow("YOURCOLNAME").toString.Contains("4060")

Assign:

strCode = CurrentRow("YOURCOLNAME").toString

Thank you, I am just curious could do an or statement? how would that work
CurrentRow(“YOURCOLNAME”).toString.Contains(“4060” or “4050”) ??

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