Skip to main content
Community site session details

Community site session details

Session Id : kowZ1FZrMAReH5yqWjTK3v
Power Apps - Building Power Apps
Unanswered

Multiple If statement to update context

Like (0) ShareShare
ReportReport
Posted on 17 Sep 2020 00:43:41 by 116

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?

  • Questionasking Profile Picture
    116 on 17 Sep 2020 at 00:45:25
    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})))

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!