Select Statement - Using Like

Hello, I am not proficient at the .Net VB language in UiPath and need some help. Currently, this is my statement:

I’m using an assign activity to create a new Datatable: here is the select statement, dtDB.Select(“[BACHNUMB] like WS”).CopyToDataTable

BACKNUMB would be the header to the column I need to gain the data from. There are other data in the column that start with other prefixes than WS, so I used a “like”. When I ran the debug on this activity, it claimed the Assign couldn’t find the Column “WS”. Clearly I have something wrong.

Advise?

1 Like

Hi @Sara_Car
Dt=dt.select(“[backnumb]=‘WS’”).copytodatatable

Try this Sara

Thanks
Ashwwin.S

1 Like

Buddy @Sara_Car

Welcome to UiPath community
you were almost done

first the reason why we got that error is we mentioned like
dtDB.Select(“[BACHNUMB] like WS”).CopyToDataTable
WS as term that would become column name rather than a value as it is not between single quotes

so mention it within single quotes and try buddy
it will work for sure, like this
dtDB.Select(“[BACHNUMB] like ‘WS’”).CopyToDataTable

Cheers @Sara_Car

@Palaniyappan and @AshwinS2

Thank you both for this, I am still receiving the error for the assign “Message: Can not find Column (WS)”.

You were correct, the single quotes was right. I just don’t know what else I could be doing. Thank you so much for your help.

1 Like

in that case better use Filter datatable activity @Sara_Car
–you can mention the datatable name
–mention the column name between double quotes as string
–the value as string as well and set the condition as CONTAINS
kindly try this and it will work for sure buddy
for more info on filter datatable activity
https://activities.uipath.com/docs/filter-data-table
Cheers

1 Like

Can you post image of your workflow?

@Palaniyappan

I have never used the Filter datatable activity, but I am sure this will work for me. Thank you so much for your assistance!

Now to make that work…

1 Like

No worries
kindly try and let know if you face any issues
Cheers @Sara_Car

1 Like

did that work buddy @Sara_Car

1 Like

@Palaniyappan

I am fixed on this now. Thank you so much!

1 Like

Thats fantastic
Cheers @Sara_Car

1 Like

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