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 / Patch and unpatch chec...
Power Apps
Unanswered

Patch and unpatch checkbox

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I want to patch and unpatch checkbox selections directly to my datasource. The problem is with my uncheck, it will only uncheck the first thing. How can I fix the uncheck so this will work?

Default - LookUp(TestResponses, Title=vUserMail && ListID = Text(ThisItem.C1)).CheckValue

 

OnCheck - Patch(TestResponses,
Coalesce(LookUp(TestResponses, Title=vUserMail && ListID=Text(ThisItem.C1)),
Defaults(TestResponses)
),
{Title: vUserMail, ListID: ThisItem.C1, CheckValue: Checkbox3.Value}
); UpdateIf(collTestMasterData, C1=ThisItem.C1, {C3:Self.Value})

 

On UnCheck - Remove(collTestMasterData, BrowseGallery1.Selected); Remove(TestResponses, LookUp(TestResponses, ID = BrowseGallery1.Selected.C1)); ClearCollect(collTestResponses, TestResponses);

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Anonymous ,

    as i read your post , my suggestion and approach is below.

    So 
    1. Approach - of you want to simply remove the Record from the Souce on Uncheck then use code like below -

    Remove(TimeSheetEntryBook,ThisItem);

    2. Approach -

    if you want to Update the Uncheck status at source then you can use the Code like below - 

    Patch(SouceName,ThisItem,{ColumnsName:"Valueneed2Update"})

    Thanks,
    Hope this will help you to resolve your issue.

    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."-Vijay



     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I am confused what should mine look like? I tried to modify both formulas. Both formulas said they had invalid arguments. Also, wouldn't I need to use a lookup or remove based on the persons email? Many people will be using the app so it needs to be removed just for that person. @VijayTailor 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I don't know the difference. I just need it to be removed from the datasource and the collection. @VijayTailor 

  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @Anonymous ,

    Then use like below.
    For remove from the Source List

     

    Remove(TimeSheetEntryBook,ThisItem);

     

     For Removing from the collection.

     

    Remove(CollectionName,ThisItem);

    Thanks,

    Vijay

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It says that the type is incompatible and the function remove has invalid arguments. The item removed needs to be based on that persons email C1 also gets the ID number of that item @VijayTailor 

  • Vijay Tailor Profile Picture
    2,961 on at

    In this requirement , Wrap the Remove function with if condition with the user and other validation true then only you can remove.

    For Error Part can you please mention here which place and for which source you getting error?

     

    Thanks,
    Vijay 

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 474

#1
Valantis Profile Picture

Valantis 474

#3
WarrenBelz Profile Picture

WarrenBelz 375 Most Valuable Professional

Last 30 days Overall leaderboard