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 / Restrict behavior of t...
Power Apps
Unanswered

Restrict behavior of toggle control in PowerApps

(0) ShareShare
ReportReport
Posted on by 1,495

I am writing this post to gain insights on whether the below requirement is possible to achieve or not in PowerApps

 

On a screen, I have a toggle control and a collection that is being created on the screen visibility. The user has the option to remove rows from the collection on the screen.

 

Now, the requirement is that the toggle control will be turned on by default when the user navigates to the screen and it shouldn't get turned off by any means until the user clears all the records present in the collection. You cannot disable the toggle control but somehow need to restrict the behavior so that the user shouldn't to able to turn off the toggle until all the records in the collection have been cleared.

 

Any idea how we can achieve this

Categories:
I have the same question (0)
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Gopala_Krishna Set the default value of the Toggle to !IsBlank(yourCollection)

    Please remember to give a 👍 and accept my solution as it will help others in the future.

  • Gopala_Krishna Profile Picture
    1,495 on at

    @CNT 

    Thank you for the response.

     

    I would like to restrict the behavior in such a way that even when the user does manual click on the toggle it shouldn't get turned off.

     

    Is it possible to achieve a scenario like that

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Gopala_Krishna Set a variable in the OnCheck, UpdateContext({varToggle:!IsBlank(yourCollection)}) and set the default of the toggle to varToggle.

    Please remember to give a 👍 and accept my solution as it will help others in the future.

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard