cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Combine If statements

Hi there, 

I am in a position where i have two individual If Statements, that work fine seperately, however i need Powerapps to check both factors before returning true or false, or in this case Disabled or Edit 🙂 

 

 

If(TimeValue(Text(Now()))>Time(09;45;00);Disabled;Edit)  //Checks if the time of the day has surpassed 0945, and decides         

whether the button should be pressable. 

If(Weekday(Now();Monday)>=5;Disabled;Edit) //Decides whether the button should be pressable based on the day of the

week, in this case "friday"



However, what i wish to do is combine these two statements into one, so that it checksfor both thing. 
So that it for example would be possible to have a button thatwould check if the time has surpassed 0945 on friday, if Yes disable the button if No the make the button available? Anyone got any suggestions? 

- Tobias 







1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Combine If statements

@Anonymous 

If I understand correctly you want to combine these two formulas so when both criteria are met the button is disabled, otherwise it shows in edit mode.

 

If(TimeValue(Text(Now()))>Time(09;45;00);Disabled;Edit)
If(Weekday(Now();Monday)>=5;Disabled;Edit)

 

You can ensure both conditional are met using the AND function.

 

If(
And(TimeValue(Text(Now()))>Time(09;45;00),Weekday(Now();Monday)>=5);
Disabled;
Edit
)

 

Hopefully this answers your question.  Let me know.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

1 REPLY 1
Highlighted
Super User III
Super User III

Re: Combine If statements

@Anonymous 

If I understand correctly you want to combine these two formulas so when both criteria are met the button is disabled, otherwise it shows in edit mode.

 

If(TimeValue(Text(Now()))>Time(09;45;00);Disabled;Edit)
If(Weekday(Now();Monday)>=5;Disabled;Edit)

 

You can ensure both conditional are met using the AND function.

 

If(
And(TimeValue(Text(Now()))>Time(09;45;00),Weekday(Now();Monday)>=5);
Disabled;
Edit
)

 

Hopefully this answers your question.  Let me know.

 

---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,850)