13
Views
6
Comments
How to convert an text condition into an actual condition
Service Studio Version
10.0.1110.0

I have a table with conditionals (<,>,<=,>=) stored as text, and wanna use them as actual conditionals.

how can one achieve that?

Rank: #448

Hi Jorge,

Do you mean to say that you want to apply the conditions as below?

if a > b then 

    a = 10

Else

  a = 20

end if

Thanks & Kind Regards,

Sachin

mvp_badge
MVP
Rank: #2

Hi  Jorge,

When you say "wanna use them as actual conditionals" what do you mean exactly? In a query? In your OutSystyems code?

Regardless, you'll need a bunch of If statements (or use a Switch) that check the specific condition and apply that accordingly. For example:

if(MonthlyObjectives.PolicyField1Contdition = ">", value > PolicyField1,
if(MonthlyObjectives.PolicyField1Contdition = "<", value < PolicyField1,
if(MonthlyObjectives.PolicyField1Contdition = ">=", value >= PolicyField1,
if(MonthlyObjectives.PolicyField1Contdition = "<=", value <= PolicyField1,
False))))