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 / Multi-Select checkboxe...
Power Apps
Answered

Multi-Select checkboxes won't stay checked when changing screens

(0) ShareShare
ReportReport
Posted on by 6

I have a form called "Tasks". Within that the user can select the date and their name and then see checkboxes within a gallery populated with tasks assigned to them for that date (see attached screenshot).

 

My goal is for people to check off tasks as they do them and send them to a single Sharepoint cell. Currently, tasks are sent to a collection called "CollectTasks" when they are clicked and then they are submitted to the Sharepoint list.

 

For the Screen I set the "OnVisible" to: UpdateContext({myTasks: Gallery3.Selected.Value})

 

For the Checkboxes I have their "Default" set to: If(ThisItem.Value in CollectTasks, true, false)

The "OnCheck" is set to: Collect(CollectTasks, ThisItem.Value); UpdateContext({myTasks: Concat(CollectTasks, Value & ",")})

The "OnUncheck" is set to: RemoveIf(CollectTasks, Value=ThisItem.Value); UpdateContext({myTasks: Concat(CollectTasks, Value & ",")})

 

Finally, I have a form submit button where the "OnSelect" is set to: Patch(Tasks_V2, LookUp(Tasks_V2, DueDate= DataCardValue13.SelectedDate && AssignedTo.Value=DataCardValue17.Selected.Value), {Title: User().Email, CompletedTasks: myTasks, CompletedDateTime: Now()})

 

The problem is: if I add to the "OnVisible" screen property to clear the collection, the checkboxes aren't checked when the user goes to a different screen and then returns. However, if I leave things as they are and swap between users, checkboxes stay checked but then tasks from multiple users are patched to the same Sharepoint row whereas I need each person to have their own row (see screenshot). 

 

Is there a way to have checkboxes stay checked for each user that I haven't figured out? I considered adding code to my patch statement to include a "Status Completed" column but as everything is a single row, the "Status Completed" might say "True" after one task is patched and other tasks still need to be done.

Screenshot 2023-03-27 at 4.50.33 PM.png
Screenshot 2023-03-27 at 4.57.37 PM.png
Categories:
  • Verified answer
    WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @rprather ,

    I am a little confused with the requirement have checkboxes stay checked for each user - their sessions should be separate as this is a collection on each of their devices. Your problem is as you stated - although the Default of the checkbox can be shortened to simply

    ThisItem.Value in CollectTasks

    as while the collection remains with the values you have added to it, the Checkbox will remain checked - if you clear the collection it will not as its data source is the collection.

     

    Please click Accept as solution 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 giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

     

     

  • rprather Profile Picture
    6 on at

    Hi @WarrenBelz - thanks for your response! Perhaps I misunderstood how collections work, I thought it each user was simultaneously making collections they would somehow combine or become problematic. So, if I understand you correctly, if I leave off "clear collection" from my "OnVisible" screen property, each user will be able to create their own collection each day, keeping their checkboxes ticked as they navigate to and from the task screen and when they patch the collection, it will only include the data from their device?

  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @rprather ,

    Yes that is correct - a collection exists on the local device only.

     

    Please click Accept as solution 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 giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 130

Last 30 days Overall leaderboard