How to Select MULTIPLE Items in Power Apps Gallery & PATCH
HTML-код
- Опубликовано: 8 июн 2024
- In this Power Apps video tutorial, we will learn how to efficiently select multiple items in a PowerApps gallery using checkboxes including a Check ALL option to select all items in Gallery.
Watch how we can save gallery item multiple selections to a Collection, Update data for selected items (collection data) and leverage a single PATCH function to apply bulk updates to your data source, eliminating the need for time-consuming For All functions.
Tutorial is aimed at beginners and intermediate users.
Key Highlights:
✔️ Manually Select items or use Check ALL option for swift selection
🔄 Update Collection data effortlessly
🚀 Boost performance with a streamlined bulk update approach with PATCH
#PowerApps #CanvasApps #Patch #PowerPlatform
🔗 Power Apps Delegation
• Power Apps Delegation ...
⬇️ Download Power App link in Community Tab for Channel Members (Silver Club 🥈 or higher)
Table of Contents:
00:00 - Introduction to Selecting Multiple Items in Power Apps Gallery & Patching the data
00:39 - PowerApps Gallery Control
00:50 - Multi select gallery items using Checkbox control in Gallery
01:46 - Save Gallery selected items in a Collection
04:28 - Show Gallery selected Items Count
05:02 - Select ALL items in Power Apps Gallery (Check box ALL function)
06:35 - Can we Select ALL items from Power Apps data source?
08:26 - Bulk Update Gallery selected items using PATCH function
13:33 - Filter & Sort Gallery data and then select multiple items to PATCH - Наука
You are a mind reader. The app that I just made… I had a request where if we can do bulk updates and now you have come up with this. I think your copilot is doing a lot of mind reading. Respect @Reza
I spend hours deciding which video topic to select. There is some madness to it :)
Great video Reza.
Congrats once more! 👏👏
Thanks for the lessons!
Thank you!
Reza, Thank you for such a powerful tutorial.
You are the best Reza! Learnt a lot from your videos. Thank you ❤
Thanks so much
Thank Reza, another great content!
Very useful video. Thank you! This is amazing!
You're very welcome!
Hi Reza Dorrani,
Everyday at work I am so grateful for your videos to be able to learn a lot of Microsoft Power Platform concepts with so much ease. You are the best!
Have a great day!
I have not come across this issue hence not sure.
Some folks did report it but later mentioned it worked fine on its own.
It's just awesome!! ❤🎉
Hi Reza, I am totally speechless, I ran out the words, this is just MARVELOUS!! Thank you!! 🌟🌟🌟🌟🌟
Wow, thank you!
@@RezaDorrani You are welcome!!
The Best By far; what do we do without you ma men
It goes both ways. My motivation is my audience.
Speechless ❤
Thanks! Veryhelpfull!!
Most welcome
thanks raza for bringing awesome content very helpful
My pleasure!
Always as Interesting video, Thank you for this.
Glad you enjoyed it
Great content! Learned a lot from you :)
Awesome, thank you!
Very useful video. Thank you Reza
Glad to hear that
You are my hero...thank you..
I understand ALL of these programming ideas, but knowing where and how to do it within PA is my pain point
Hi Reza. This video solved a lot of my "problems". Great work and thank you.
You’re most welcome
Updating 500 items were very fast. I did not expect that! ❤
🚀
Can you show how to overcome the delegation limit beyond 2000? ie do batches of 2000 until end of file or something?@@RezaDorrani
Thank you for this video❤. Waiting for a video on PAD new features.
I have no plans for PAD videos as I do not work on that.
as always- great video , thanks . Hoping for videos on Power automate too please in future
74 videos and growing on Power Automate ➡️ ruclips.net/p/PLTyFh-qDKAiEs0rhQuR7fwSv5_63FHr_0
@@RezaDorrani New ones i meant , great content always though
@@arunv1909 New ones are being added each month.
Tks
Wc
Hi @RezaDorrani,
First of all, forgive me for making this comment. I follow you regularly and I love your videos but there is something I would like to correct, with the code you have put in the Update. The most optimal way would be with this code:
Patch(
'Issue Tracking List',
ShowColumns(
colData,
"ID",
"Status",
"Priority"
)
);
because the way you are doing it, it is updating all the columns in the list and the most effective way is to update only the two columns you are updating.
That's exactly what I thought when I saw the PATCH call. But apart from that still a great video (I learnt again something new). Thank you, Reza. ❤
Thats a great point and Im very happy to see it being made.
In another video I did show showcolumns while Patching and a lot of viewers got confused (using different data sources + importance of having primary key in there)
Hence to make it simple, I decided not to do that here 😉
Hi! This works like a gem! But im worried, will this work on large dataset without hidden issues? Like how the patch function knows what record to update? Because of the “ID” column? Thanks!
@@wallshider Yes, it knows because of ID column.
If worried, best to test it out first.
Superb 🎉🎉🎉.. Worked perfectly for me. Thank you.
Bravo
Thanks
Awesome! 👏👏👏👏. I was just searching for this exact tutorial earlier today. Thank you Reza
Great!
Hi Reza! thanks for the great videos. Do you have a video for patching nested galleries with check boxes in each item to patch selected items?
For instance say I have a parent gallery that Items are 1, 2, 3, 4, ... and each Item has its own items that I have created using group by function. I want to patch all the selected items and repeat parent gallery items in the first column for all the selected items in the child gallery. Thank you!
Welcome!
I do not have a video on that scenario.
Love this video Reza. Wil this work if my gallery is using a Startswith filter for the items property? It's a large data set, so we use drop downs to filter it to return all the data from 2000+. Will the update still work?
Do you want user bulk updating 2000+ records in one go?
It will work but user will have to scroll in gallery so gallery loads all that data assuming the query is delegable.
Great Video Reza! very useful. I am looking to complish similar one using Comb box multiselect and trying to update the values at backend(dataverse). The columns I am trying to update are lookup columns. If you have done similar work around this requirement can you share the link to your video. Thank you so much.
Thanks!
I dont think I have a specific video reference on this. I will recommend checking on the forums at powerusers.microsoft.com/ in case someone has done something similar.
Hi, did you have any success patching lookup column data? I put the lookupcolumn values into a collection and then tried using showcolumns in the patch to specify those, it doesn't like non record values though.
Just in time great video 👍👍, the only issue I'm having with this method is when I change the same drop-down twice it gives a network patch error this is because my collect is set on the drop-down Onchange property is there a workaround?
It depends on how you have configured it.
I have not come across the mentioned issue and hence not sure what the cause could be.
I recommend posting your issue on forums in case someone has experienced something similar powerusers.microsoft.com
YES, I am about to launch a power app in our production facility and needed THIS special functionality, Thanks!!
Is there a way to check all items that has a special value in a Column? For example, select all items that have "January" in the "Month" Column?
Yes . Clearcollect(filter(data source,month field = January))
Just need to add a filter instead of clear collecting entire list
Most welcome!
@@jq1683 thanks!
I literally just had to build this last week while developing an app. But I for some reason did it a little different using an IsSelected column in the separate collection instead of just adding & removing from it.
But if I go back & better match this set up, I can link to this video & avoid doing documentation for that part of the app.
Good luck!
@@RezaDorrani Already got it set up. Better to gather around standardized methods so things seem more familiar to anyone going into our apps later.
Thanks Reza
You are simply a magician! thank you for the great guide. I was wondering if is possible to have a dropdown for each item in a gallery with different values and be able to patch the different values from that dropdown for each item respectively. I tried it with a ForAll since my gallery would get just a few cases at once each time but it doesnt work, it patches the same value as the selected item on the gallery for all the items no matter what. I thought maybe I could clearcollect at each ForAll iteration but that is also not possible. Anyway, thanks again for the video.
Thanks!
Your scenario is more like a grid style of gallery. I have done 4-5 videos on that. Check playlist on grids on my channel.
Thank you! I solved it watching the guide one about editable grid using modern controls.
Thanks so much for your tutorials, Reza! I am applying the Patch function described at the 14:45 minute mark to a SharePoint List. However, I am applying it to a gallery populated by a GroupBy variable. It would seem that items cannot be updated within a GroupBy context. So, I must use ClearCollect to take the selected items and place them in another table..? Does that sound correct? Thanks so much for you time!
Welcome!
Group By has a different schema for gallery.
I don’t have a specific video on this so not sure what the code would look like.
I recommend posting your query on forums in case someone has experienced something similar powerusers.microsoft.com
Thanks for your reply! @@RezaDorrani Yes, there is a post on the forum similar to my issue, but I am having trouble formatting. I may just create a new post. Interestingly, my app will allow the Patch formula as it is described in the video to make a SharePoint List update, but only once. After that submission an error message is produced.
@@user-wg1wl1ji9s Sounds weird. Something would surely not be right. Try put a new post.
Reza, thank you a lot for your videos and contribution in the Microsoft forum!
I would like to ask a question if you don't mind.
When I released my app, I noticed there is no multiple photo selection through the attachment control. That means I can't select some photos once at time when upload them. The issue is only on Android and iOS platforms through the PowerApp mobile app.
But,
It works fine on the web browser for any platform.
Researched and found nothing.
Any solutions so far?
Thank you
I don’t think there is any out of the box feature for that. It is a known limitation.
@@RezaDorrani oh, thank you
I love you reza 😂
Thanks
I like your videos about power apps , in relation with this one I have a question , how to approach the scenario when from those two columns I want to update only one , let's say status and priority to leave as it is already for each individual record?
Remove that column from collection that you do not want to patch prior to making the patch call
so will be a case of IF and isempty or isblank of the fields that you make available to determine which ones to patch @RezaDorrani ?
@@john1537 yes
Hi Sir..Thank you for the video i found it more interesting so that i can use it in my work…I have one question as i am building a car booking application where users select the date and time using date time picker Power apps has to list down the list of available cars on the specific mentioned time..I couldn’t achieve this any suggestions please
Depends on how schema of your data.
Idea would be to filter data. I have done many videos on filtering that you can check.
Thank you so much, for this, Reza! So just to confirm: If I have a filter on my gallery ITEMS, and I click "Select all," it will select only those gallery items that are filtered, is that correct?
Yes, as long as check all has the same filter condition when collecting data in collection.
Note collection max limit* is max delegation limit which is 2000
Reza was there a reason behind you choosing the classic checkbox over the modern one?
Yes, to mix things up. Modern checkboz was in preview at time of making the video.
Reza, have you considered making a video on how to select favorites in a gallery and then filter the gallery by favorites only (Sharepoint list)? This would be very helpful for my facilities directly app! Thank you for the consideration.
I have not. My rule for video requests is set - "I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted topic ideas get added to my backlog. Make sure to suggest this idea whenever the next topic suggestion post is out."
Hi Reza, I implemented the solution you outlined in this video. I also used one of your techniques to copy items in bulk. I have one issue, though. Once the gallery refreshes its items, then I can't clear the collection, and the checkboxes are all checked. I can't figure out how to stop the loop as I quite like the concept of informing the user that a change requires saving and, therefore, triggering the patch on selection of the controls inside the gallery. Any suggestion?
I have not run into any issues with gallery refreshing so Im not sure how I can help.
Hi, this was really helpful. Do you have a video available showing how to update People column when applying changes to multiple records? I want to show the requestor name/e-mail next to each record.
I don’t remember doing one on this scenario
@@RezaDorrani Hello Reza, thank you for responding. Is this something you might be interested in creating a video on, or have a workaround you could propose?
@@komalahmeds6740 I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted topic ideas get added to my backlog. Make sure to suggest this idea whenever the next topic suggestion post is out.
Hello @RezaDorrani! I used your method here and it works perfectly fine. But, when I checked the select all check box on a filtered gallery, it still selects all items. For example, I have 30 total items in the gallery and when I filtered it, gallery will show 15 items. When I ticked the select all check box on a filtered gallery, it will still select all 30 items. Is there a work around on this?
Thank you for making this content as it really helps the beginners like me in creating apps. 😊
As shown in video, it works on filtered items as well. Link to download sample app is available for channel members (check description for details)
Thank you Reza, you are a legend 😊
Hi Reza, if we want to copy items are we forced to use For All?
I have done 3-4 videos on bulk updates including copying like feature.
Hi Reza, thank you for the video, can I ask what if this time I just want to update only status but not the priority? I tried to leave the priority as blank, but it will just patch it as blank.
Add if condition and check if value is left blank then don’t include that in the update record
@@RezaDorrani UpdateIf(
colData,
true,
{
TaskresultStatus: If(
!IsBlank(ComboBox2_1.Selected),
ComboBox2_1.Selected,
ThisItem.TaskresultStatus
),
'Assigned to': If(
!IsBlank(ComboBox2.Selected),
ComboBox2.Selected,
ThisItem.'Assigned to'
)
}
);
Patch(Ticket, colData);
Clear(colData) is this formula wrong? it doesn't work for me... but I can't see what is incorrect....🥲
@@RezaDorrani sorry can I ask what is wrong with this formula below? UpdateIf(
colData,
true,
{
TaskresultStatus: If(
!IsBlank(ComboBox2_1.Selected),
ComboBox2_1.Selected.Value,
colData.TaskresultStatus
),
'Assigned to': If(
!IsBlank(ComboBox2.Selected),
ComboBox2.Selected,
colData.'Assigned to'
)
}
);
Patch(Ticket, colData);
Clear(colData) I can't get it work, sorry I am new to power apps, so please pardon me if this question is too silly...
@@meng-shanwu4475 I cant guess the issue here on chat.
I recommend posting your issue on forums (best place to post issues as there are many experts who assist)
powerusers.microsoft.com
Very helpful video, thanks very much! I wonder if you can make a video about patch function returns value especially returning table value. I use Dataverse table as data sources, in one situation that I want to copy from records from the same table. That means inserting new records with new unique identifier and few columns value changed from existing records. And I need each patch returned value (new record) that will be used to create new records for sub tables…
I do not have a video reference on this scenario and would have to try it out to provide guidance. I recommend checking on the forums at powerusers.microsoft.com/ in case someone has done something similar.
Hi Reza, that would be great if you can make a video or guide for the scenario! It similar to your this video but add another complexity, instead of updating it is inserting or create new records. I don’t see it can be done with bulk patch? I have to use ForAll then Patch which is working fine. The difficulty things are that I need the returned records from Patch one by one…ex: I have two galleries GalleryFrom and GalleryTo their Items are same collection, the collection is ClearCollect from a Dataverse table. A ComboBox for dropdown (custom page) bind to one field of collection (categories) to control the GalleryFrom display list. User can choose items from GalleryFrom move to GalleryTo. I want to save GalleryTo items with a fixed Category (means GalleryTo bind only one known Category) without Sources Categories items change. Its copy from other Categories items to current Category. I remove/delete all records from Dataverse table for this Category Before I save/patch ForAll items in GalleryTo because user can move between the two galleries freely. I made it work at this point. I also need the created record inside loop to patch related tables/sub tables information (SubTasks or Stages). That’s what I need returned records of Patch function…
@@kellyliu4225 I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted idea gets added to my backlog. Make sure to post this idea whenever I post the next topic suggestion post.
@@RezaDorraniI’m sure this video if you make will have a big impact in the community. It is beyond basic and very little information about the topic out there. Thanks!
@@kellyliu4225 I know but my rule for making videos is set. Best to post this idea and let the community decide by votes.
Thank you so much, I have faced a problem because my gallery uses filter dropdown. and when i change the value of the filter the checkboxes are reseting again. how to stop the checkboxes from reseting? thank you again
Not sure about it. I will recommend posting your issue on forums in case someone has experienced something similar powerusers.microsoft.com
@@RezaDorrani Thank you, I figured out the problem, because the check boxes has no reference in my collection or list. so their values are not stored anywhere.
Hello Reza
I am using a SQL view as my data source. So in the Patch function I would need to first map the primary key of my source table to the unique column of my view. So how can I modify the patch function to suit the view data source?
I have not tried with sql views, so not sure about the options.
I tried but could not do it, any news? would help!
@@mauroquinteros8783 I dont plan to try it out. I would recommend checking or posting your query on forums in case someone has done something similar
powerusers.microsoft.com/
Hi Reza, how we can bulk delete in the same app you showcase?
Check function removeif
Hi Reza, do you do 1 to 1 consultation to build a site inspection mobile app. they will be around 100 questions and each qns will have a Yes, No field, a comments box and a camera upload.. thank you
I do not provide 1:1 consultation
How about also doing some stuff for model-driven apps?
I did not get many requests on it. I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted topic ideas get added to my backlog. Make sure to suggest this idea whenever the next topic suggestion post is out.
Hi Reza, This was working fine for me till last few days the suddenly I am getting the error when I am patching "Network error when using Patch function The specified column is read only and can't be modified" :(
Check recent comments on video. Its some issue with latest version of power app that I am unaware of.
Do you have a video that will show how you can update, then have it send an individual email for each record that you updated? For instance, I have "Approved" as a status, once it is approved, an email goes to the next approver to review. Can I do that all on the same button? I tried using the patch but it will only send the email for the record that is selected and not the others.
I do not have a video reference on this scenario. I will recommend checking on the forums at powerusers.microsoft.com/ in case someone has done something similar.
@@RezaDorrani I will, but just so you know, you are the best. Thank you!
Hi Reza
Thanks for this video...
I used the Patch function as shared in this video and the App was working fine from last 2 weeks, but today i get the error "Network error when using the Patch function: The specified column is read-only and can't be modified." now I am unable to resolve this error. Could you provide a hint to resolve this ?
I have not come across this issue and hence not sure what is the cause for your issue. I recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
Hello Buddy, got a solution on this? is so please share I'm as well stuck and will much appreciate @Ashish
patch not working with dataverse? says guid record doesnt match table. any videos or links or workarounds?
Dataverse unique identifier is a guid type column not ID as in SharePoint.
I don't think I have a specific video reference on it. I recommend checking on the forums at powerusers.microsoft.com/ in case someone has done something similar.
❤
Hi Reza, I'm trying to create a multi select combo box in a gallery and patch those values (comma separated) back into sharepoint as text. Is this possible?
I dont have a video reference on this.
I recommend checking or posting your query on forums in case someone has done something similar powerusers.microsoft.com
I'm having issue here that when I create a variable it duplicates in all items of gallery. I saw in one of your posts that we should use collection instead of variable. Can you please help me with an example?
@@mizbhakhanum3974 debugging issues here on chat is not an option. Your best bet would be to post your issue on forums. There are various users who assist in their free time on forums.
Hello. Can this work with the powerBI integration? I want to do this inside a powerBI report.
Possible. Technique will be similar not same.
@@RezaDorrani Hello again Reza.
Will you make video where you make a gallery with a choice column with the PowerBI integration? I'm trying to select multiple rows and change their category, but it wont work. I just want to be able to change multiple rows and change their category on a status choice column. The code i have has no error, but it does not make and change and updates to the SharePoint list.
Should i make a collection as a pre step? I dont know lol.
Good videos as always.
/ Kenneth.
@@kennethgottfredsen767 I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted idea gets added to my backlog. Make sure to post this idea whenever I post the next topic suggestion post.
Better to post your query on forums.
@@RezaDorrani Ok i will keep that in mind. Do you now a forum where I can post my problem?
@@kennethgottfredsen767 powerusers.microsoft.com
Please make a video on this
I have a job application form which is built by using patch Functions.
In this I want to add Multiple Company experience (i.e. If anyone has 10 years' experience with 5 companies) with Role, Location, From date, To date, Organization Name and Job Type.
This fields may add for 5 or 10 times also depends on consultants as Naukri or LinkedIn Portal.
They select on(+) or add then the same repeating required details should be visible
How can I make this??? As I have prepared other information in form.
I make videos when I receive multiple requests on a topic. Every 6 months I ask subscribers for topic suggestions on Community Tab of my channel. Most voted idea gets added to my backlog. Make sure to post this idea whenever I post the next topic suggestion post.
Hi Raza
When using Updateif() im getting error in patch() i., e update function : the specified column is ready-only and cant be modified "
I have not come across this issue and hence not sure what the cause could be.
I recommend posting your issue on forums in case someone has experienced something similar powerusers.microsoft.com
Hello Buddy, got a solution on this? is so please share I'm as well stuck will appreciate @user-y
When I try to Patch the Collection to my Dataverse table it says it cannot patch Read-Only columns such as "createdby". How can I get it to Patch each record then?
I have not come experienced this and hence not sure what is the cause for your issue. I recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
I'm having the same issue!
@@kimwickens4367 Tell me if you find a fix please
Hi Reza, do you know why I would be getting a network error that the column is read-only when it worked initially?
No clue about that
@@RezaDorrani I am having a similar issue. I wonder if it is a versioning update problem. It is because there are columns in the row of data that can not be modified; "filenamewithextension", "fullpath", etc. I was able to stop this by adding ".columnname" that I am modifying after the collection name in the patch formula. However, I am now creating new items every attempt, and can not get the original item to update.
@@user-wg1wl1ji9s Might be related. I have no plans to investigate on this issue as Im working on next set of video ideas.
If you dont find a solution, please post it here so others can benefit from it
@@RezaDorrani Same error, this is not working
@@RezaDorrani Okay, so I haven't fixed the issue but I did get some additional info. I have an app published using this technique and it still works. The app uses version 3.24041.27. The app versions that I have made updates to and have not published use 3.24042.28, and they are now erroring. I have tried restoring the previous version, but power apps then removes it as an option once I attempt to restore. So, I need to learn a little about version histories. For now, don't update your currently published apps and they may still work until a better resolution is found.
I have created gallery with checkbox and i want to add a new row to gallery. How can i do this.
Please check my playlist on grids
In my gallery i have to click two times to check the checkbox. Why does this happen? The first click selects the item and second click checks the checkboz
I’ve not experienced this so not sure
@@RezaDorrani it happens on flexible height gallery with modern checkbox. It works with normal gallery and modern checkbox. Not sure what the reason is though
@@joywindsouza817 I have not tried with flexible height gallery so not sure
How to add a new row to gallery
I will recommend watching my playlist on grid controls
@@RezaDorrani Thank you
@RezaDorrani always showing us the SMART & CLEAN way to code. HIGH LEVEL, Thank you🤌
I try my level best and so happy to hear the feedback.
@@RezaDorrani 5 years from now when Power Platform is older lol you will be the reason for its growth and stability in the market.