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 / Published form does no...
Power Apps
Suggested Answer

Published form does not disable required buttons on initial opening

(1) ShareShare
ReportReport
Posted on by 32
Hello
 
I have a app that works fine but on initial start up it seems to forget to disable the required buttons.
 
Once I interact with the form one it then starts behaving itself.
 
Its a simple form
 
This is what it looks like on initial startup
 
 
this is what is should start like based on the variables
 
 
 
Start button
 
If(varNewItem.'Active-Session'= false And Checkbox1.Value=false, DisplayMode.Disabled,
If(varNewItem.'Active-Session'= false And Checkbox1.Value=true, DisplayMode.Edit,
If(varNewItem.'Active-Session'= true And Checkbox1.Value=true, DisplayMode.Disabled)))
 
End Button
 
Set(varNewItem,Patch('Job-Log',LookUp('Job-Log', varNewItem.ID = ID), {'End-Time':Now(),'Active-Session':false}));
UpdateContext({varTimerActive: false});
UpdateContext({varTimerReset: true});
Reset(Timer1);
If(TPMCheck=true,
 Set(TPMCheck,false),
 Set(TPMCheck,true))
 
Thanks for taking the time to read this
 
Geoff
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,968 Moderator on at
    Hi,
     
    The only thing I can suggest is to add some Text Labels on the screen and verify what the values are, which should clarify why it's not happening. 
     
    When you say "interact" with the form, what exactly does that mean?
     
    Next, I would say that your code is missing a default value.
     
    You have a double level If, but in no way do you have a "if its not any of those, then make it Enabled" (the default) or Disabled)
     
    I would re-write it like this, and there is another way too but I am keeping what you have kinda.
    If(
       (varNewItem.'Active-Session'= false And Checkbox1.Value=false)
       Or
       (varNewItem.'Active-Session'= true And Checkbox1.Value=true)
    ,
       DisplayMode.Disabled
    ,
       DisplayMode.Edit
       // varNewItem.'Active-Session'= false And Checkbox1.Value=true I have ignored this as it doesn't matter that its even here.
    )
     
    Now I see this in the Display Mode for Start,
    But I don't see code for the Display Mode or End
     
    I changed it above, because it seems like you are not properly setting your values but without having a way to check them for you and the rest of the code. Hard to fully help.
     
     
  • CU04091518-0 Profile Picture
    32 on at
    Thanks for the reply
     
    I added labels for the values
     
    This is the sequence I am getting when starting the app from new
    You can see the displaymode code on the buttons is not applied
     
    #1
     
    #2
     
    I check the checkbox and hit the START button, now the displaymodes are working
     
     
    #3
     
    I press the END button , again the displaymodes are working ( we should see this  when first starting the app)
     
     
    #4
     
    This is what happens when the checkbox is checked, displaymodes working 
     
    Then the sequence should start again ,so
     
    Initial state= Start / End buttons disabled / Checkbox unchecked
    Checkbox ticked = Start Enabled,
    Start button pressed = Start Disabled, End Enabled
    End Pressed = Checkbox, unchecked, Start Disabled, End Disabled
     
    than we are back at the initial state.
     
    Like I said before, after going through the sequence once the app works perfectly, its just the initial start that for some reason does not disable the buttons?
     
    Again thanks for your time on this, appreciated
     
    Regards
     
    Geoff
     

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard