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

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

classic icon displaymode not working

(2) ShareShare
ReportReport
Posted on by 688
Hi,
 
I have a save icon that checks is one of the field is a form is filled in to be in edit displaymode
 
The DisplayMode is set to
If(!IsBlank(DataCardValue77.Selected.'Animal (doa_animal)') Or !IsBlank(DataCardValue78.Selected.'Animal (doa_animal)') Or !IsBlank(Trim(DataCardValue75.Text)),DisplayMode.Edit,DisplayMode.Disabled)
 
If I check by higlighting the displaymode code of the icon it says disabled, still it behaves like enabled
If I set a label to above code it says disabled
If I set another label to IconAccpt1.DisplayMode it says edit
 
I am extremely curious for a logical explanation.
Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    52,569 Super User 2025 Season 2 on at
    classic icon displaymode not working
     
    It would be good to show pictures of the Ux so we can see if its grouped with something else, or layered etc.
     
    What I would do, also, is in the code highlight each section and see if they are true or false, then highlight it all and see what it picks.
     
    Also, you said the label says disabled, but if the label (with words) greyed out? or can you click it?
     
    I'd have to see the screen really and all the parts together to help you resolve it as... something isn't correct, I just cannot tell if its how you are checking, or if its how the screen is designed.
     
    I cannot reproduce it though.
     
  • CU28091219-0 Profile Picture
    2 on at
    classic icon displaymode not working
    Hi Hans,
     
    I see you are using Or function but I don't see any proper bracket use which is required for OR function can you please change you condition to below code 
     
    If(!IsBlank(DataCardValue77.Selected.'Animal (doa_animal)') || !IsBlank(DataCardValue78.Selected.'Animal (doa_animal)') || !IsBlank(Trim(DataCardValue75.Text)),DisplayMode.Edit,DisplayMode.Disabled)
    if this doesn't work can you please remove everything after selected i.e. use DataCardValue77.Selected only instead of using DataCardValue77.Selected.'Animal (doa_animal)' because you just want to check blank not exact value from your combobox
     
    --------------------------------------------------------------------------------------------------------------------
    Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider clicking Yes to the question Was this reply helpful?
     
    LinkedIn- https://www.linkedin.com/in/akshansharma/
    Github Repo - https://www.youtube.com/@akshanshsharma3114
    --------------------------------------------------------------------------------------------------------------------
  • Akshansh-Sharma Profile Picture
    285 Moderator on at
    classic icon displaymode not working
    Hi Hans,
     
    I see you are using Or function but I don't see any proper bracket use which is required for OR function can you please change you condition to below code 
     
    If(!IsBlank(DataCardValue77.Selected.'Animal (doa_animal)') || !IsBlank(DataCardValue78.Selected.'Animal (doa_animal)') || !IsBlank(Trim(DataCardValue75.Text)),DisplayMode.Edit,DisplayMode.Disabled)
    if this doesn't work can you please remove everything after selected i.e. use DataCardValue77.Selected only instead of using DataCardValue77.Selected.'Animal (doa_animal)' because you just want to check blank not exact value from your combobox
     
    --------------------------------------------------------------------------------------------------------------------
    Please click Accept as solution if my post helped you solve your issue. If the content was useful in other ways, please consider clicking Yes to the question Was this reply helpful?
     
    LinkedIn- https://www.linkedin.com/in/akshansharma/
    Github Repo - https://www.youtube.com/@akshanshsharma3114
    --------------------------------------------------------------------------------------------------------------------
  • Verified answer
    WarrenBelz Profile Picture
    152,667 Most Valuable Professional on at
    classic icon displaymode not working
    The Or stucture in your post is valid (there are several ways of expressing this function), however there are a few things you might want to try to get to the bottom on this. Firstly, the IsBlank test assumes a null value. Controls can at times contain an empty string (especially the last one and is why you will see the IsEmpty test). Using the Len (Length) function covers both of these
    If(
       Len(DataCardValue77.Selected.'Animal (doa_animal)') > 0 Or 
       Len(DataCardValue78.Selected.'Animal (doa_animal)') = 0 Or 
       Len(Trim(DataCardValue75.Text)) = 0,
       DisplayMode.Edit,
       DisplayMode.Disabled
    )
    the next thing in the debugging exercise is to put this on a Label
    If(
       Len(DataCardValue77.Selected.'Animal (doa_animal)') > 0 Or 
       Len(DataCardValue78.Selected.'Animal (doa_animal)') = 0 Or 
       Len(Trim(DataCardValue75.Text)) = 0,
       "Edit",
       "Disabled"
    )
    and it will return (in text) the mode that your icon should be in.
    Also what do you mean by  still it behaves like enabled
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful?
    Visit my blog
    Practical Power Apps    LinkedIn  
  • HansHeintz Profile Picture
    688 on at
    classic icon displaymode not working
    About
    "If I check by higlighting the displaymode code of the icon it says disabled, still it behaves like enabled"
     
    I mean that
    -if in edit mode I highlight the code for the displaymode property this Icon to evaluate it in the editor, the editor gives me the value disabled
    -if In run mode the Icon and I click the icon the onselect property will be executed, hence it behaves as enabled
     
    Probably more a case for the support people at microsoft as this can't be right.

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

Coming soon: forum hierarchy changes

In our never-ending quest to improve we are simplifying the forum hierarchy…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 724 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
SebS Profile Picture

SebS 239 Moderator

Last 30 days Overall leaderboard