web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / DisplayMode setting bu...
Power Apps
Answered

DisplayMode setting but not updating

(0) ShareShare
ReportReport
Posted on by 133

Hi,

I have what I think is a simple issue but I can't seem to fix it.

I have a 'Request' application which asks for Approval/Rejection from another user. (all data in SP List by the way).

psadd2_0-1656697095963.png

In the image above the Request has previously been Approved and so the Approved button is now disabled. Let's say a mistake was made and the Approver now wants to Reject the Request...if I hit the Reject button it Patches the list field "Sponsor Approved" : No. Currently the Display Mode of both buttons depends on the Sponsor Approved field in my list... "No" should disable Reject and enable Approve....vice versa for Sponsor Approved being "Yes".

The issue is that although the patch is working I have to exit and reload the application to see the new state of the buttons.

How do I get the buttons to reload with the change of data in the Sponsor Approved field while I'm still on the page?

 

Thanks

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @psadd2 

    Most likely you are using a variable for your control of the displaymode.  My suggestion would be to get rid of the variables and put your formula direct in the displaymode properties of the controls.

     

    Beyond that, please share your formulas so that more guidance can be provided.

     

    I hope this is helpful for you.

  • psadd2 Profile Picture
    133 on at

    Hi Randy...thanks for the prompt response.

    I do have a couple of variables in there but I wouldn't have thought they were affecting the button.

    I'll check and get back to you.

    Thanks again

  • psadd2 Profile Picture
    133 on at

    Hi Randy,

    Nope still not getting anywhere with this. I'll share the code for the 'Reject' button and maybe you can spot what's going on.

    OnSelect

    Patch(
    'Change Control - Main',
    LookUp(
    'Change Control - Main',
    'Change Number' = varFormData.'Change Number'
    ),
    {
    'Sponsor Approved': "No",
    'Sponsor Notes': rtxtSponsorNotes.HtmlText
    }
    );

    That code 'patches' a couple of fields in the Change Control - Main SP list.....and it's doing that fine. As you can see it sets the 'Sponsor Approved' field to "No".

     

    Display Mode

    If(
    LookUp(
    'Change Control - Main',
    'Change Number' = varFormData.'Change Number'
    ).'Sponsor Approved' = "Yes",
    DisplayMode.Edit,
    DisplayMode.Disabled
    )

    This does have a variable in it but only to check the correct record is being patched...so the it's just checking for the same Change Number. Then, if the 'Sponsor Approved' field is "Yes" it sets the 'Reject Button' to edit but if it's already "No" then it's Disabled.
    If I reload the app it all works like a dream...but I can't get it to reassign the Display Mode of the button on the fly.

    Thanks for you help.

  • psadd2 Profile Picture
    133 on at

    Thanks for your help Randy....I had a Twilight Zone moment....took the dog for a walk, came back and the code that I posted below worked fine. Must have been a cache issue or something. Anyway, all seems to be working now.

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @psadd2 

    Sometimes a few moments with the dog is all it takes 😉

    Glad you got it working!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard