i don't want my if to be two branch only 

i want to to be able to use if else 

example:

if (role = "role1)

{show this}

else if (role = "role2)

{show this}

else if (role = "role3)

{show this}


thanks


Hi Abdulrahman,

In your example you can use the OutSystems Switch statement.

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Implementing_Logic/Web_Logic_Tools/Switch

Regards,

Daniel

Daniël Kuhlmann wrote:

Hi Abdulrahman,

In your example you can use the OutSystems Switch statement.

https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Implementing_Logic/Web_Logic_Tools/Switch

Regards,

Daniel

it doesn't show up for me!?

i also typed switch in the search bar but i couldn't found it

You have to open a screen server or service action to see the toolbar on the left with the switch and if.

In the screenshot you have a screen open so the toolbar only shows widgets you place on a screen

If you want to condition the visibility of a part of screen or particular widget, select the widget or container then right click mouse to get popup menu and from there select 'enclose in if' menu option.


Daniël Kuhlmann wrote:

You have to open a screen server or service action to see the toolbar on the left with the switch and if.

In the screenshot you have a screen open so the toolbar only shows widgets you place on a screen

If you want to condition the visibility of a part of screen or particular widget, select the widget or container then right click mouse to get popup menu and from there select 'enclose in if' menu option.


that's what i did but it only show two branch true and false

what i need is 'else if' or 'switch' statement 


Solution

That is not possible there, the only way can do it is have nested if or multiple if's at same level.

Solution

guess i have to put multiple if, sure it's not efficient but it will do for now

thanks for your help and sorry i took your time. <3

Abdulrahman BnSultan wrote:

guess i have to put multiple if, sure it's not efficient but it will do for now

thanks for your help and sorry i took your time. <3

Yes you are right, and don't be sorry, the forum is to help.