In abbyy flexicapture setup station, how can I check for a checkbox value by c# script?

Want to check if value checkbox is not checked than assign value of a different check box. But getting error that -

Operator ‘==’ cannot be applied to operands of type ‘object’ and ‘bool’ (line 1, pos 4)

if(Context.Field(“2_3”).Value == false) {
Context.Value = Context.Field(“rgn23”).Value;
}

So what is the right way to check for check box value and how to assign a different check box value to this one.

Hi
Welcome to UiPath Community:)

In the second line please change the code to Context.Field(“2_3”).text = Context.Field(“rgn23”).Text or Value

Let us know if this heps.

Regards,
Pavan H

hey thnx for ur reply but both of the fields 2_3 and rgn23 are checkbox type. And .Text is not working there

Hey,

Replace .text with .value in both the places

Cheers,
Pavan

No issue with second line now but in first line (if statement ) I am getting -
Operator ‘==’ cannot be applied to operands of type ‘object’ and ‘bool’ (line 1, pos 4)

Hi,

if (this.Field(“F1”).Value == true){
this.Field(“F1”).Value = this.Field(“F2”).Value
}

I have writtien it using javascript in abbyy rule section for the field.

I am getting the expected result.

Try this way, may be it will help.

Let me know if not.

Regards,
pavan H

1 Like

It worked. Many thnx pavan for ur help.

1 Like

Happy to help.

Regards,
Pavan H

1 Like

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