Multiple IFs in no code formula?

I have a button text that I want to change according to the status of a variable.

If status = A, I want the text to show “text A”.
If status = B, I want the text to show “text B”
If status is anything else, I want the text to show “text C”.

How do I do this?

I’m trying to use the “IF” no code formula but I can only make it such that if it’s A, show text A, if its everything else, show text C. but the system doesn’t take into account B. I’ve also tried having “and” between 2 IF statements which I thought was working but it doesn’t show correctly too.

What formula should I be using for “multiple if” conditions?


:joy: :sob:

the switch case would be more preferable but it doesnt seem to have the default condition like a normal switch operator would.


from my point of view, i’d use javascript for this * because* it’s a simple operation and the no-code method doesnt allow for this easily. I suppose you could create a variable that is for that text element. when an option is updated int he app, you could use the multi-option split operation and set a variables value to display accordingly

Oo, thank you. I will give the multi split option a try. :grin:

the switch case would be more preferable but it doesnt seem to have the default condition like a normal switch operator would.

You can use the switch and add or yourDefaultValue to achieve the same :slight_smile:

Edit : But be careful, if one of your value is falsy (0, “”, null, false), it will return the defaultValue instead, so you can do that trick only if you have no falsy values in your switch

1 Like

Hey Alexis! What if it’s a multiple IF PLUS contains formula is needed?

I have a slug, url.com/cows, url.com/dogs, url.com/cats, url.com/cowpoop, url.com/ dogbones

So if URL contains “cow”, I want it to return 1.
If URL contains “dog”, I want it to return 2.
If URL does not contain either, I want it to return 3 as default value.

You can try to create your own switch formula by embedding multiple successive if

if
else
  if
  else
    if
    else
if(contain(myVar, "cow"), 1, if(contain(myVar, "dog", 2, 3))