cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

IF with some options for TRUE


My question is simple and involves the If function.

I have a variable that refers to the status of my stock product. There are more than 10 possible types of different statuses, but I want to make a function that IF the status is equal to "Status A" or "Status B" or "Status C" or "Status D" THEN does the action.

 

It is enough that only one of the 4 statuses that I have listed is the same as the current one to trigger the action. Inside the IF everything goes well when I put only 1 status in the condition, but I want it to happen correctly for any of the 4 I mentioned, I tried to use ||, && and Or between the statuses in the IF but it doesn't work.


Can someone help me? I imagine it is something simple.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@santpaiva 

You can consider to put these all in the If statement such as:

If(yourVar = "Status A" || yourVar = "Status B" || yourVar = "Status C" || yourVar = "Status D", ...

 

You can also shortcut it with the following:

If(yourVar in "Status A|Status B|Status C|Status D", ...

 

The bars ( | ) in the above are only there for visual separation. 

 

I hope this is helpful for you.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

1 REPLY 1
Super User III
Super User III

@santpaiva 

You can consider to put these all in the If statement such as:

If(yourVar = "Status A" || yourVar = "Status B" || yourVar = "Status C" || yourVar = "Status D", ...

 

You can also shortcut it with the following:

If(yourVar in "Status A|Status B|Status C|Status D", ...

 

The bars ( | ) in the above are only there for visual separation. 

 

I hope this is helpful for you.

 

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (53,149)