Assingn with Boolean Variable

Assingn with Boolean Variable

  
Hello.

Can anyone tell me how to implement an assignment like this:

Variable: Var1 (type boolean)
Expression: if(Condition, True, False)

The system always displays the error "Bollean data type required instead of Text", because it considers all the inputs as Text.
There is no TextToBoolean function so how can I implement the instruction without using separated if statments?

Thanks in advance.
Hi Alexandre,

From the example you gave you could just do:

Variable: Var1 (type boolean)
Expression: Condition

If you want to convert a Text to a Boolean you can just use the expression

SomeTextVariable="True"

Cheers,
Tiago Simões
Hi Tiago.

Thank you for your quick answer.
In fact I have tried that also but didn't work to. I send an image with the error to be more precise.
Hi Alexandre,

Use just: GetQuote.Current.QUOTE.PartnerId = ""

The If function always returns text, so if you use it to assign a value to a boolean variable then you get the error you posted.

I hope this helps you. Cheers,
André
Hi André.

Thank you for your explanation but this was just a little example of what I need, and for this situation that would solve the problem.

What I realy need is to do the following:

Variable: Var1 (boolean)
Expression: if(Condition1, True, if(Condition2, True, False))

Or even whith more if conditions inside, and this way I don't see how can I implement what you have said.

Thank you.
Best regards.
Hi,

Probably the problem, is because you are using a text identifier, instead of an normal integer id, if have something like this if(ActionRecord.Record.TechnicianAction.ActionId=IntegerToEntityRefInteger(1),true,false), works.
If-constructions always return a text.
Text can be converted to Integers.
Integers can be converted to Booleans.

This is what you probably want:

IntegerToBoolean( TextToInteger( If( Condition, 1, 0 ) ) )

Kind regards,

Remco
Hi Remco Dekkinga.

Thank you for your answer, that solved my problem.

It's not very nice to use 2 functions to do the job but it works just great.

Thank you, once more.