cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Multiple If statement to update context

Hi im trying to create a multiple if statement where if a  number from a gallery is larger than 24 or smaller than the gallery number then update a variable,

previously i had these the two if statments and two variables and it worked however my app now needs to combine them (this is the working code)

 If(Value(Can_SMU.Text) > Value(Sum(Gallery3.AllItems, Value(ASS_SMU.Text))) + 24, UpdateContext({CalButton:true}),UpdateContext({CalButton:false}) &
If(Value(Can_SMU.Text) < Value(Sum(Gallery3.AllItems, Value(ASS_SMU.Text))), UpdateContext({CalButton2:true}),UpdateContext({CalButton2:false})))


and this is what i thought should work?

If(Value(Can_SMU.Text) > Value(Sum(Gallery3.AllItems, Value(ASS_SMU.Text))) + 24 || If(Value(Can_SMU.Text) < Value(Sum(Gallery3.AllItems, Value(ASS_SMU.Text))), UpdateContext({CalButton:true}),UpdateContext({CalButton:false})))

 

but it does not?

1 REPLY 1
Highlighted
Frequent Visitor

Re: Multiple If statement to update context

im a mong

 

its 

 

If(Value(Can_SMU.Text) > Value(Sum(Gallery3.AllItems, Value(ASS_SMU.Text))) + 24, UpdateContext({CalButton:true}),UpdateContext({CalButton:false}) &
If(Value(Can_SMU.Text) < Value(Sum(Gallery3.AllItems, Value(ASS_SMU.Text))), UpdateContext({CalButton:true}),UpdateContext({CalButton:false})))

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,394)