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 / Gallery with checkboxes
Power Apps
Answered

Gallery with checkboxes

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

So I'm super stuck. I have a gallery that contains checkboxes and is connected to SP list A. When a box is checked, I add the checked item to a collection:

If(
!IsBlank(
Filter(
'Project Time System',
Project = ThisItem.Project)), Collect(submitProjects,ThisItem), RemoveIf(checkedProjects,IsBlank(Checkbox3)))

 

When the user presses a submit button - the information from the collection is patched (new record created) into another SP list SP List B using:

ForAll(
Collection,
Patch(
SPList,
Defaults(SPList),
{
Columns and values....
}
         )
)

Everything works great, however - I'm stuck on once a record is added to SP List B, I would like to remove it from SP List A which will remove it from the gallery AND I want to remove it from the collection. This should be able to submit all checked items from the gallery at the same time. Any help is really appreciated - like I said - suuuuuppperrrr stuck =o)

Categories:
  • poweractivate Profile Picture
    11,078 Most Valuable Professional on at

    @Anonymous 

     

    Where are you stuck? Are you able to remove it? You can remove it using Remove or RemoveIf

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-remove-removeif

     

    Please give more details where you are stuck.

  • PaulD1 Profile Picture
    2,914 on at

    The Remove/RemoveIf (from the SharePoint list) could go in as part of your ForAll statement. Then recreate your collection after the ForAll has completed (if you gallery, that you are iterating through in the ForAll, is based on a local collection, I don't think you can modify that collect, by removing items, while in the ForAll loop).

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Do you want to remove the record from your List A and submitProjects collection when you submit the record into your List B?

     

    Based on the needs that you mentioned, I think the RemoveIf function could achieve your needs. I have made a test on my side, please consider take a try with the following workaround:

    Set the OnSelect property of the "Submit" button to following:

    ForAll(
     submitProjects,
     Patch(
     'B List',
     Defaults('B List'),
     {
     ProjectColumn: submitProjects[@Project],
     ...
     }
     )
    );
    Refresh('B List');
    RemoveIf('A List', Project in 'B List'.ProjectColumn); // Remove records from List A
    RemoveIf(submitProjects, Project in 'B List'.ProjectColumn) // Remove records from colletion

    Note: I assume that the Project column is a Primary column in your ListA. The Project column value from ListA would be saved into the ProjectColumn in ListB.

     

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for the responses everyone - I am going to mark this as the solution - the way I figured it out is a little different:

    ForAll(
    submitProjects,
    Patch(
    Project_Time_Master,
    Defaults(Project_Time_Master),
    {
    Title: Title,
    WeekStarting: WeekStarting,
    Project: Project,
    Task: Task,
    Monday: Monday,
    Tuesday: Tuesday,
    Wednesday: Wednesday,
    Thursday: Thursday,
    Friday: Friday,
    Saturday: Saturday,
    Sunday: Sunday
    }
    )
    );
    Refresh('Project Time System');
    ForAll(
    submitProjects,
    Remove('Project Time System', LookUp('Project Time System', ID = submitProjects[@ID])));
    RemoveIf(submitProjects, Project in Project_Time_Master.Project)

     

    If you see anything wrong with this or if it might fail as the list gets large (this is going to be for keeping track of time spent on projects for an entire department) please respond

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

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard