Hi,

OS11,ReactiveApps

Without using any variables, If the first condition is already true then the result will display and other condition will ignore.is this possible ?

This is what I tried so far ,this is dummy data only:

Hi,

The last example is how you should donit, you separate the conditions with an Or. As you see it is also the most easy and readable one. 

Regards,

Daniiel

Hi Harlem,

"If the first condition is already true then the result will display and other condition will ignore"

This description it's exactly what the OR condition does. It returns true if either condition is true and it evaluates conditions by their order. As soon as one condition returns true, others won't even be evaluated. If the first condition is true, then the other conditions will be ignored.

Also, like Daniël said, it's the most readable one, for someone who needs to check your code in the future.


Kind regards,

Rui Barradas

Hi,

I agree with what Daniel said. And in case the conditions are tested by an AND instead of an OR, I advise you to put one condition per filter.

Cheers

Daniël Kuhlmann wrote:

Hi,

The last example is how you should donit, you separate the conditions with an Or. As you see it is also the most easy and readable one. 

Regards,

Daniiel

Yes, I also agree that this is the readable one . but as you can see, it does not return the result I want. it still evaluates the second condition even the 

Room.RoomNumber = "VIP2"

is already true.


Hello Harlem,

What is the result that you want to achieve then?


Kind regards,

Rui Barradas

Hello Harlem.

I think I understand what you are saying. You only want to see the first room available?

"If the VIP2 is available, send them there, if not, find a room with space for them"

Well, the query returns all valid rooms. It is up to the sorting section to define what room to show first. You can have an attribute saying VIPs are preferable over normal rooms.

If you really only want one room (not very honest for an hotel), you can set the query to return only one record. set Max Records.01 It is on the properties section of the query.