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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / CONFLICT OF CHECKBOXES
Power Apps
Answered

CONFLICT OF CHECKBOXES

(0) ShareShare
ReportReport
Posted on by 57

Hi community,

I really need your help, as you can see on the below Gallery, i tried many time but in vein,

-i want if the toggle1box is checked then all checkboxes on "YES" will be checked and uncheck all checkboxes on "NO" title, and Vis-Verse.

-i want if you press on Reset button then all checkboxes will be unchecked.

-finally i want by defaults if the checkbox has been checked and saved before, to remain checked.

 

Privat2020_2-1663931392185.png

 

i tried many time but with no success. if you need my code i can let you know it as well. Thanks.

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Hi @Privat2020 ,

    Try this: Hope this will be helpful for you. I didn't try resetting, please share your code then I would get a better idea about your Gallery situation. 
    On Toggle 2:

    OnCheck=UpdateContext({T2:true});UpdateContext({T1:false});
    OnUncheck=UpdateContext({T2:false});UpdateContext({T1:true});

    Default=T2

     

    On Toggle 1:

    OnCheck=UpdateContext({T2:false});UpdateContext({T1:true});

    OnUncheck=UpdateContext({T2:true});UpdateContext({T1:false});

    Default=T1

    Checkbox1: Default = T1

    Checkbox2: Default = T2

    Refer:

    VishuS_0-1663957882285.png

    VishuS_2-1663957965525.png

     

  • Privat2020 Profile Picture
    57 on at

    Hi @Anonymous ,

    Thanks for your feedback, i tried your code and i still have some malfunction,

    actually i have a sharepoint list with two columns, one for YES and other one for NO, means when i press the save button it patch the word YES if checkbox1 has been checked and NO if checkbox has been checked, and my gallery in powerapp should by defaults keep the already checked box, means when you open the powerapps next time then you will still be able to see the already checked box last time,

    so all those functions i mentioned worked well, means save the checked value in sharepoint list and by defaults the app still keep the already checked values.

    my code : defaults checkbox1: T1 ||If(Toggle1.Value=true;true) || If(ThisItem.yes="yes";true;false) || If(Toggle2.Value=true;false)

                   defaults checkbox2:  T2 || If(Toggle2.Value=true;true) || If(ThisItem.no="no";true;false) || If(Toggle1.Value=true;false)

    On Toggle 2:

    OnCheck=UpdateContext({T2:true});UpdateContext({T1:false});
    OnUncheck=UpdateContext({T2:false});UpdateContext({T1:true});

    Default=T2

     

    On Toggle 1:

    OnCheck=UpdateContext({T2:false});UpdateContext({T1:true});

    OnUncheck=UpdateContext({T2:true});UpdateContext({T1:false});

    Default=T1

     

    -so the issue is that if check the toggle1, checkbox1 will be checked, but actually one the other side checkbox2 should be automatically unchecked but now if checkbox2 has value it can not be unchecked.

     

    -about reset button, i actually need if i press on reset button, then all checkbox1 and 2 and toggle1 and 2 will all be unchecked means all to false.

     

    Privat2020_0-1664188022394.png

     

  • Privat2020 Profile Picture
    57 on at

    Hi @Anonymous ,

    i tried the new code from your idea then finally got it about checkbox, thanks!

    here is the defaults for chechbox 1 and 2: i used:

    T1||If(T2=true;false;ThisItem.yes="yes";true;false) || If(T2=true;false) || If(Toggle2.Value=true;false)||

    If(Toggle1.Value=true;true) || If(T2=true;false)

     

    T2||If(T1=true;false;ThisItem.no="no";true;false) || If(T1=true;false) || If(Toggle2.Value=true;true) || If(Toggle1.Value=true;false) || If(T1=true;false)

     

    thanks again,

    can you help me on the reset box if i press it, then it will put all checkboxes to false and all toggles to false as well?

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi @Privat2020 ,

    In your case I am suggesting a rough approach; Modify the below code as per your exact need:
    Just create one more variable on the reset button, and if variable VarReset = true, then make all default values false. 
    And on Toggle selection update again variable VarReset to false.
    On Reset button selection:UpdateContext({VarReset:true}); If(VarReset=true,UpdateContext({T2:false});UpdateContext({T1:false}))

    Toggle  2: OnCheck=UpdateContext({T2:true});UpdateContext({VarReset:false});
    OnUncheck=UpdateContext({T2:false});UpdateContext({VarReset:false});
    ChekBox2:If(VarReset=true,false,T2||If(T1=true,false,ThisItem.no="no",true,false) || If(T1=true,false) || If(Toggle2.Value=true,true) || If(Toggle1.Value=true,false) || If(T1=true,false)))

  • Privat2020 Profile Picture
    57 on at

    Hi @Anonymous ,

    Thanks a lot, everythngs works well now.

  • Community Power Platform Member Profile Picture
    on at

    Great 👏

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

Forum hierarchy changes are complete!

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

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard