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 - Mismatch...
Power Apps
Answered

DisplayMode - Mismatch between formula and button

(0) ShareShare
ReportReport
Posted on by 24

Hi all,

 

I've come across this issue a couple of times in this app. I've got a complex formula to determine whether or not a button should be enabled or disabled. But, as you can see in the screenshot, sometimes the formula will show the correct value of disabled, but the button is enabled. And that fixes itself and breaks randomly.

 

DisplayMode error.jpg

 

 

Any thoughts on why this is happening? Let me know if you need further information or other bits of my app. 

DisplayMode error.jpg
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @AndreaHB ,

    Can you please remember to post your code in Text as it saves re-typing here. This code is OCR'd, so please watch spelling. I broke this down a bit to save duplicity

    With(
     {
     _Assets:
     Filter(
     gal_Assets.AllItems, 
     chk_SelectAsset.Value
     ),
     _Attach:
     LookUp(
     ’DEV - BC Attachments’, 
     BCID = var_currBC.ID, 
     AttachmentType.Value = "Financial model”
     )
     },
     If(
     IsEmpty(_Assets) ||IsBlank(_Assets) ||
     First(_Assets).currPhase = 0 ||
     First(_Assets).currPhase = 20 && IsBlank(_Attach) ||
     Countlf(
     Ungroup(
     Filter(
     col_tempAssets,
     mandatoryPhase = First(_Assets).currPhase
     ),
     "assetvalues"
     ), 
     requirementMet <> true && 
     assetID in _Assets.ID
     ) > 0,
     DisplayMode.Disabled, 
     DisplayMode.Edit
    )

    but the bit I do not understand the logic on is here - what are you doing with the ungrouped table and what are you filtering the bottom values against ?

    Countlf(
     Ungroup(
     Filter(
     col_tempAssets,
     mandatoryPhase = 
     First(
     Filter(
     gol_Assets.Allltems, 
     chk_SelectAsset.Value
     )
     ).currPhase
     ),
     "assetvalues"
     ), 
     requirementMet <> true && 
     assetID in Filter(
     gal_Assets.AllItems, 
     chk_SelectAsset.Value
     ).ID
    ) > 0

     

  • AndreaHB Profile Picture
    24 on at

    Hi @WarrenBelz ,

     

    Thank you for your help. I didn't post the code as text because I didn't think the code was the problem, considering that the formula bar was giving me the right result. But I was wrong and you were right 🙂

     

    Your version of the code is much neater - I've replaced it in my app and it works, thank you.

     

    To answer your question, the CountIf part is filtering the col_tempAssets, where I'm storing the mandatory fields for each asset and for each phase of the process. col_tempAssets has a row for each field, and an embedded table called assetvalues, which stores the values entered in that field for each asset. If there are any assets for which the requirementMet column is not true, the button should be disabled.

     

    Thanks again! 

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
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard