Check Column if it contains value and return Boolean

I have a file(image below) and I would like to get a true or false value if there is a Mid or High inside the file in column C
image

I don’t need to use for Each row because what I need is the entire column.

@VegitlX_HuNteR Can you Explain us the Process what you want to perform ? Also Can you Show us what is the Output Format of Excel you need, if you want to have Excel File as the Output?

I don’t need to manipulate the excel file. I just need a return value of true or false if the file contains high or low. If there is then it should should proceed to the next activity.

The problem if I use for each row is that it will try to check all the row. Or if there is something that will stop the for each activity if it meets the condition then we can use for each. But for me the most efficient way of doing is is checking the Column if it contains a “High” or “low” value without doing for each.

1 Like

@VegitlX_HuNteR So you just want to know if the Column has High or low as it’s Value right ?
In that case, Simple method would be to use Filter Datatable with Conditions that you want. Then Check the Count of the Output Datatable. If the Count is Greater than 0, It means it does contain “High” or “Low value”

Use a for each row and inside assign use below code, @VegitlX_HuNteR
Var(Boolean type) = If(row(“Column C”).Tostring.Trim.equals(“Mid”) Or row(“Column C”).Tostring.Trim.equals(“High”),“True”,“False”)

2 Likes

Create a macro that checks for column C value and updates it to true or false.
Use Execute Macro activity in UiPath to call the macro

1 Like

Hi @VegitlX_HuNteR

Read range with headers from the excel file to get a Datatable variable “dt”, if the header of column C is “Col3” use below method to check if there is a Mid or High inside the file.
dt.Select(“Col3 = ‘High’ or Col3 = ‘Mid’”).Count > 0

1 Like

I tried this and i got an error.

1 Like

Where should i put this “dt.Select(“TAG = ‘High’ or TAG = ‘Mid’”).Count > 0” in the IF of Assign activity.

Put your proper column name as your input file. @VegitlX_HuNteR

1 Like

it worked using this method :). Thanks @Manish540 to also @Madhavi and @supermanPunch

1 Like

The correct solution for this can be found here:

1 Like

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