How to use OR in a VB Expression?

I have used the following code for getting the corresponding row value if a column value is “Fail”
“(DT1.Select(”[Status]=‘Fail’ “).CopyToDataTable).DefaultView.ToTable(False,“Application_URL”)”
What i need is if the status can be either “fail” or “No response”, how to restructure this VB expression for this criteria??

Thanks in advance :slight_smile:

Hi @im_heathen

As I understood, there is a column named “Status” in the datatable. Given that, you may need to try the following condition in a For Each Row in a Datatable activity:

row.Item(“Status”)=“Fail” OR row.Item(“Status”)=“No response”

Can i be able to do the same for a VB expression?? I don’t want to use a for each. The expression gets invalid if i use a OR operator inside a VB expression so is there any other symbols or expressions can be used to perform OR operation inside a VB Expression??

“(DT1.Select(”[Status]=‘Fail’ or "[Status]=‘No response’“).CopyToDataTable).DefaultView.ToTable(False,“Application_URL”)”

Try this @im_heathen

1 Like

Ha, it works. I used [Status]= ‘Fail’ or ‘No Response’ lol.
Thank you :slight_smile:

1 Like

In vb.net is better to use OrElse operator instead of simple “or”. OrElse is shortcircuited

1 Like