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 select multipl...
Power Apps
Answered

Gallery select multiple items for bulk update into SP List

(0) ShareShare
ReportReport
Posted on by 44

Hi All,

 

I am quite new to power apps hence little chaos when building my very first power apps. Appreciate if i could get help via this community forum 😉

 

In my power apps, i have a Gallery sourced data from SP List XYZ. I want to allow user to select item(s) from the Gallery <colGalleryList> (by ticking a Checkbox <'Checkbox3'> built inside the Gallery) and perform bulk updates on 2 fields (field 'ABC' with dropdown and field 'Text Comment' free Text) onto the SP List XYZ. I refer to the video clip from Reza Dorrani (https://www.youtube.com/watch?v=VzrarcM9W5k) when i built the 'Patch' function for the bulk updates, and it is working fine. Now, instead of user tick one by one the item(s) from the Gallery, i have added another Checkbox <'Checkbox 1'>outside of the Gallery for user to select/unselect all items from the Gallery. I managed to set this 'Checkbox1' to select/unselect items from the Gallery 'Checkbox3', but, with this mass-selected approach, my Patch function doesn't work. I suspect something needs to be set in the 'Checkbox1' and the Patch formula, i tried tweaking the formulas but failed... Below are the details from my canvas:-

 

'Checkbox1' outside of Gallery to select/unselect all items in the Gallery:-

OnCheck property: Set(varcheck, true)

OnUncheck property: Set(varcheck, false)

Default: blank

 

'Checkbox3' inside the Gallery for user to tick and select the item:

OnCheck property: Collect(colUpdates,ThisItem)

OnUncheck property: Remove(colUpdates,ThisItem)

Default: varcheck

Reset: varcheck

 

Patch button for the multi-lines bulk update:

UpdateIf(
colUpdates,
true,
{
'ABC': If(
IsBlank('ComboBox ABC'.Selected.Value),
'ABC',
'ComboBox ABC'.Selected
),

'Text Comment': If(
IsBlank('TextInput Text Comment'.Text),
'Text Comment',
Concatenate(
User().FullName & " " & Today() & ": ",
'TextInput Text Comment'.Text,
"; ",
Char(13),
'Text Comment'

)

)

}

);

Patch(

'SP List XYZ',

colUpdates);

Notify(

"Records Updates Success".

NotificationType.Success

);

Clear(

colUpdates);

Refresh('SP List XYZ');

ClearCollect(

colGalleryList,

'SP List XYZ'

);

Reset('ComboBox ABC');

Reset(TextInput Text Comment)

 

Initially without the Checkbox1 for select/unselect all, the Patch function is working fine and the bulk updates successfully reflected in the SP List XYZ, but now if i use the Checkbox1 to select all item, the Patch doesn't work, data not updated in Gallery nor SP List...

 

Appreciate someone could help me with the above-mentioned.🙏

 

Thanks, LS

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

    Hi @SwanKoay201 
    Try this outside check box OnSelect add this 

    If(
     Self.Value,
     ClearCollect(
     colUpdates,
     GalleryName.AllItems
     ),
     Clear(colUpdates)
    )





    Outside checkbox OnUncheck

    Clear(colUpdates);Set(varCheck,false);

    Outside checkbox OnCheck

    Set(varCheck,true);

     

    Inside checkbox default

    Checkbox1.Value // Outside check box

     

  • SwanKoay201 Profile Picture
    44 on at

    Hi @Ramole,

     

    Thanks for that, the last item in your reply Inside checkbox default , is the '// Outside check box' coding valid?

    Checkbox1.Value // Outside check box

     

    Also, with the setting you advised, the Inside Checkbox setting below remained the same?

    'Checkbox3' inside the Gallery for user to tick and select the item:

    OnCheck property: Collect(colUpdates,ThisItem)

    OnUncheck property: Remove(colUpdates,ThisItem)

    Reset: varcheck

     

    Question: if user use the outside Checkbox to select all the items, can user manually untick/unselect some of those selected items? or the user can only untick the outside Checkbox to unselect all and then manually tick 1 by 1 using the inside Checkbox? reason i asked so, when i preview, after tick the outside Checkbox and selected all the items, if i were to manually untick/unselect some of those selected items, it prompts error 'The specified record was not found'

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @SwanKoay201 
    Add that inside gallery checkbox default 

    Checkbox1.Value // Outside check box name
  • SwanKoay201 Profile Picture
    44 on at

    Hi @Ramole ,

     

    Ok, added that in the Inside Checkbox Default property. Would you be able to help on my question:-

    Question: if user use the outside Checkbox to select all the items, can user manually untick/unselect some of those selected items? or the user can only untick the outside Checkbox to unselect all and then manually tick 1 by 1 using the inside Checkbox? reason i asked so, when i preview, after tick the outside Checkbox and selected all the items, if i were to manually untick/unselect some of those selected items, it prompts error 'The specified record was not found'. The Inside Checkbox OnUncheck property: Remove(colUpdates,ThisItem) is throwing error as well

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @SwanKoay201 

    It should yes and will also patch correctly if selected all outside checkbox, test it 

  • SwanKoay201 Profile Picture
    44 on at

    @Ramole 

     

    When i preview the apps, if i tick on the outside Checkbox, all items in the Gallery were selected and the Patch function works fine. But, after selected all the items, if i tried to unselect a few of the selected item in the Gallery, the apps prompt error 'The specified record was not found'.  When i return to the canvas, the inside Checkbox OnUncheck property: Remove(colUpdates,ThisItem) is throwing error as well. Is it something that i have to tweak in this formula to allow user unselect some of the all selected items?

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @SwanKoay201 
    Use this 

    RemoveIf(colUpdates,ID = ThisItem.ID)
  • SwanKoay201 Profile Picture
    44 on at

    @Ramole 

     

    Thanks for being patient with me, but when i put in the formulas in the inside Checkbox OnUncheck property, it throw error per screenshot below:

    SwanKoay201_0-1683271330944.png

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    @SwanKoay201 
    What is the code you have on inside checkbox OnCheck ?

  • SwanKoay201 Profile Picture
    44 on at

    @Ramole 

     

    The inside Checkbox OnCheck property=Collect(colUpdates,ThisItem)

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
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard