Reza, I regret that I cannot give one million likes for this video. I have reduced the time it takes to save the entries to my SharePoint list right now from 2 minutes to just 6 seconds thanks to your video. And it took me less than 5 minutes to change the code. Thank you so much for your tutorial, it has been a great help!
Exactly what i needed to see right now. Thanks Reza. Official doc's are not covering these scenarios and even the blog you shared doesn't go beyond the speed aspects. Shame documentation or blogs aren't more available.
Thanks David. Sometimes the docs do not represent the true capabilities of a particular feature. I feel the bulk update technique using collections is a gem that many are not aware of.
Hi Reza Thank you for taking the time to share your knowledge with us! I have created a similar app with a bulk select feature, using Dataverse as a backend. Once records have been patched into the database (code of the On Select button being totally executed) , the gallery may take a few seconds to reflect the changes made. In that case, end-user can still select an item in the gallery that looks brand new, and click update. Consequently, because the new database ID of the record is not yet showing in the gallery, a duplicate record is created upon patching. And since there is no On Refresh event for galleries, it's difficult to know when the gallery reflects the changes made in the backend (refreshes are not synchronous). I am sure you have already faced this use case, and I am curious to know how you are dealing with it. Thanks!
I have not faced the issue around duplicates. Once user clicks submit button, you could always overlay a control over the grid which blocks user from making changes until the submit action is complete.
Hi Reza you are genie whenever i end up road block in power apps i search and always found a solution or you guided me to the same awesome content each and everyone of them
For reference, if someone wants to use the ID of added items in this method, you do need to include the ID column in your collection, otherwise the ID won't be present in the returning collection. You can use Blank() as the value to add new items, the Patch return collection will include the correct ID value then.
Can you please be more specific though?will the Adding the primary action make it update instead of creating new item? I want to duplicate the item with pre-defined values for primary key. Can you give me an advice?
Great video and learning morning morning. I have implemented the collection technique for delete and update but never tried the copy / duplicate approach, good tip Reza!
@@RezaDorrani I'm getting this error while trying to upload the app package: "! Something went wrong. Please try again later". Does any one else is getting the same error? I've tried several times, same thing. P.S. Great video, thanks Reza!
I have learnt a lot from your videos more than I have learnt in my 4 years of B.E... Reza, could you please create a video on how to create the view that is being presented in this video with the drop downs and buttons?
Great video. Everything works at my side except for one thing. I am working with a SharePoint list called Pets. While copying records (creating New record), the lines "ClearCollect( colDataToPatch, DropColumns( colUpdates, "ID" ) ); Patch( Pets, colDataToPatch ); " Still give me the error "Network error when using the Patch function. Field 'Id' is required "
I will have to look at your App in action to provide guidance. I would recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
@@RezaDorrani I solved it by using the Showcolumns option in stead of Dropcolums. Showcolumns worked while Dropcolumns gave an error that ID was required. Huh???????? What ??????? How ??????? 🙂
Absolutely love your videos! Learnt lots and saved me many hours. One question, How does your select all work? I can update the gallery item check boxes, but it doesn't add anything to the collection!! If I manually select a record or many it is added to the collection.
Thank You! Video description has link to download the solution file (which includes the App). Its been a while I did this, so I don't exactly remember the Select All code.
Thank you so much Reza, you are such a great teacher! Is is possible to use these methods to update the user to an empty or blank value for Sharepoint?
Thank you Reza, another excellent video. In the past I have used Collect(Datasource, collection) instead of Patch(Datasource, Collection) for new items. What will the difference be?
Hello Raza, Thank you so much for your videos. It helps me to update the logic you have built in the apps. Can you please share the video link for this end-to-end creation? I need exactly same scenario, I am unable to figure out multiple selection in check box and applying status change for the selected records.
I do not have an end to end video guide on this. If have tons of independent videos covering various concepts shown in this video. Check my Power Apps playlist.
Hi Reza, using your video I created a new app and it helped me so much thank you so much. I am using bulk patch just facing one issue of errors. I want to show success msg but only if there is no error. Tried multiple things but still having issue with error handling, do you have any video for that?
I do not have a video related to error handling. When you execute the Patch function, if you set a variable example: Set(varResult, Patch(...)) The variable will have all the details you need for error handling.
Reza, I’m using Sharepoint and I’m wanting to take a value in field 1 and duplicate that value into field 2 for each record. Each record will have a unique value in field 1, so am I still able to use the UpdateIf since it’s not an across the board all having a static value for all of them. Thanks for your work!
Wonderful video @Reza Dorrani. Thanks for this. Appreciate if you can share the formula as I am getting error while importing the file from GitHub link that you shared.
Hi Reza, (UPDATING COMMENT TO REMOVE QUESTIONS I HAVE FIXED) I had great success using your UpdateIf and Patch solution to bulk update a number of records in PowerApps. I am now attempting to use the same solutions for a Power App embedded into a Power BI report as follows: - Select Records in PowerBI - Show Records in PowerBI Gallery using PowerBIIntegration - I am able to copy a single record and update certain fields needed using the following (great!): Patch( kycPackageXclause, //Dataverse table Defaults(kycPackageXclause), { kycPackageXclause_kycPackage: LookupKYCPackage.Selected, kycPackageXclauseAppliesTo: ChoiceAppliesTo.Selected.Value, kycPackageXclause_kycPackageRelatedParty: LookupRelatedParty.Selected, kycPackageXclause_clause: LookupClause.Selected, kycPackageXclause_jurisdictionStandard: LookupJurisdictionStandard.Selected, kycPackageXclause_listOfValues: LookupListofValues.Selected } ); - I am now trying to achieve similar with multiple records,. - I create a collection from the gallery ClearCollect(KYCxCLCollection, GalleryPowerBIKYC.AllItems) - I use a checkbox within the NewForm to indicate where a field needs to be updated with another value. The UpdateIf statement is being accepted If( CheckboxKycPackage.Value = true, UpdateIf( KYCxCLCollection, true, {'KYC Package Name': LookupKYCPackage_1.Selected.kycPackage} ) ); - I create another collection from the initial collection but drop to IDs to ensure power Apps creates new records. This works fine! ClearCollect(CopyMultipleKYCPackagesCollection, DropColumns(KYCxCLCollection, "crb8f_kycpackagexclauseid", "crb8f_kycpackagexclauseuid")); - But the final Patch statement, recognises the source being my inital CDS table "kycPackageXclause" does not seem to like this new Collection I have just created "CopyMultipleKYCPackagesCollection" I guess because it is multiple records rather than just one? Patch(kycPackageXclause, CopyMultipleKYCPackagesCollection) I can't understand why this works in a straightforward PowerApp, but doesnt work for a PowerApp reading from PowerBI. Any insight MOST HELPFUL, if you can understand everything I have written above!
Hi Laura, I am working on a project that involves the Power Apps visual in Power BI and executing bulk update. Process is similar to yours. What I do is based on items in the Power BI data set PowerBIIntegration.Data, I create my own collection using forall on PowerBIIntegration.Data. The column column names match the exact names in my data source. To get the base collection definition, I use defaults(Datasource).
@@RezaDorrani Hey Reza, I am trying your proposed method but still failing to get my Updated Collection to save back to the DataSource due to differences between the Record vs Table format of data. This doesnt work...... Patch(collection, Defaults(sourcetable), {SourceField:CollectionField})); I got round this by trying....... Patch(collection, Defaults(sourcetable), { SourceField: LookUp(sourcetable, sourcefield in [@Collection].crb8f_CollectionField) })); If the collection contains 4 records, all with different field content, the Patch will create 4 records, however all 4 records are crreated exactly the same, but the fields are populated based on the first record Power Apps finds in the Collection table (I guess because I am using the Lookup function) This is the best way I can explain, it. Collection Records Record 1: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: Field updated by user so different from source data Record 2: FieldA: 2a FieldB: 2b FieldC: 2c FieldD: Field updated by user so different from source data Record 3: FieldA: 3a FieldB: 3b FieldC: 3c FieldD: Field updated by user so different from source data Record 4: FieldA: 4a FieldB: 4b FieldC: 4c FieldD: Field updated by user so different from source data New Records Required Record 5: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: Field updated by user so different from source data Record 6: FieldA: 2a FieldB: 2b FieldC: 2c FieldD: Field updated by user so different from source data Record 7: FieldA: 3a FieldB: 3b FieldC: 3c FieldD: Field updated by user so different from source data Record 8: FieldA: 4a FieldB: 4b FieldC: 4c FieldD: Field updated by user so different from source data New Records Created Record 5: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field Record 6: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field Record 7: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field Record 8: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field Do I need to change when I trigger the ForAll loop or something?
Hi Reza, thanks a lot for sharing your knowledge in that way! Incredible and amazing method that you found (or create!) instead 'ForAll' to perform the bulk actions... I have a question: why does the Patch() function work with the collection if it expects a record? and in the same way, why does Patch() function update only three columns of the data source when the three columns collection is included as argument? Shouldn't be sent the data of the rest of columns like Defaulst()?... How does it work?... Thanks again!
The answer is in the documentation - docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch Patch can do a lot more than just adding or updating a record.
Superb video Reza, thanks! I Learned so much from your tutorials. The direct patch from collection to sharepoint list works however as soon as I include a ForAll loop to add items to the collection before the Patch I get an error: Invalid argument type (Table). I expect some of the sharepoint list fields expect a record which I explicitly have to supply when creating new items. I know the whole point here is to avoid the ForAll but in my scenario I do want to add a few records before patching the collection to the sp list. Welcome any suggestions.
I will have to look at your App in action to provide guidance. I would recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
thanks a lot and i have a question:Patch( DataSource, BaseRecordsTable, ChangeRecordTable1 [, ChangeRecordTable2, … ] ) , why in your video,only 2 without baserecordtable?
Raza, I tried this operation using a "view" from a sql table (we use 3NF for all our tables...so we often create views to drive certain galleries in powerapps to avoid using "Lookup" func within a gallery). The view however, contains the Primary Key and other ID columns so we can easily work with patch functions, forms, etc. For some reason, this seems to only work when the gallery items is the actual table, and not the view. When I hover over the error displayed over the Patch function it reads "Invalid argument type (Table), expecting a Record value instead". Should I be wrapping the collection in a First(Filter( function? Or will this only work when the gallery is connected to the actual table? Thank you in advance for your time! Awesome material!
Hi Reza. You reference the variable "varFilters" but you don't show where and how it's set. Could you please explain? Thanks for all the great learning content.
I do not have a video reference on this scenario and would have to try it out to provide guidance. I recommend checking or posting your query on forums in case someone has done something similar powerusers.microsoft.com
Thank you, Reza, for another great video. I have dataverse for teams app and I want to duplicate entries. can we use the same method to copy records in dataverse for teams?
Thanks for your reply. More specifically, I am using a version of your paginated list gallery, except I have added a checkbox column and trying to perform the same function as in this video. When I try to patch the separate SharePoint list, however, it tells me it expects a record and not a table.
@@jacksonbender6478 I would have to look at your App in action to know the root cause of the issue. As per the error, looks like formula needs a collection (tabular) data but is being provided a record. I would recommend to post your issue with screenshots on the forums at powerusers.microsoft.com/
Turns out it was the list schema. Many thanks. Also, do you know of a way you can assign a unique ID to each row you select (patch) to the new SharePoint list?
Hi Reza, thanks for the great video, I believe UpdateIf is not delegable, is there a workaround to remove multiple items that meet conditions in a delegable way?
Since we are working with collections, we need not worry about delegation. User will select items from gallery which is delegable and we are adding it to collection to update.
Its a gallery that has the Choices of the Status column. I have not covered exactly this use case in a video. I am working on a video on creating Tabs in Power Apps. The technique is exactly the same as this.
Hi Reza, thanks for sharing your expertise on powerapps with the community! Your videos are tremendous help when I was creating my app. But I have a question. Is it possible to do a bulk create from canvas app to dataverse table? I tried doing a patch from a collection to dataverse table but it has a few errors such as "Patch function has invalid arguments" and "Name isn't valid. Description isn't recognized." Your help would be appreciated. Thanks!
Video shows how it works with Dataverse as well. I will have to look at your App in action to provide guidance. I recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
Thanks so much Reza for a great tutorial!!! This is going to help tremendously. I have a follow up question though. My 'OnCheck' formula does not add records to the collection when I select all records by clicking on the 'Check All' button. It works fine when I check each box inside the gallery. Any thoughts? I'll greatly appreciate it. Thanks again! :-)
Thank you Reza for this video. Is it possible to patch duplicate records by defining x number from user. For e.g. is this video you are selecting number of records to duplicate but instead of selecting how can you patch let say user typed 8 times he/she needs to duplicate the records?
Hi, Great video. Is it possible to get the app in another form than a solution. Within mine company imported solutions are not allowed. Thanks in advance
Reza thank you for the detailed explanation. I am stuck when i am trying to update dataverse with Lookup values. It works for update gallery existing records but cannot insert ForAll( Filter( Gallery5.AllItems, Toggle2_1.Value = true ),
Hi Reza, Thank you for the Video, this gives a lot of information together to learn. I have implemented this in my Project work using SharePoint online everything is working but in one case - " I selected the records from Gallery, Every time I have selected more than two records but When I click on delete only 2 records being deleted rest selected records remain their in the gallery", Please suggest if any solution for this. Many Thanks in advance.
When u select records, then must be going into collection. Check if it has all selected records. It would be tough to guess what your issue is here on chat. I will recommend you post your issue with screenshots on the forums at powerusers.microsoft.com
Hi Reza - Another great video and was just dipping back into it to aid bulk updates as part of a doc management app I am building. I am noticing when I try to patch the entire collection following an update to a people field in the collection, the Patch formula doesn't like it when I try with just the collection. When I modify the formula to also include the column name i.e. Patch(source, collection.peoplecolumnname), the error disappears, but the patch doesn't work. Do you know if there are limitations with patching a full collection to a doc library and / or with people columns?
I have not tried with Person type column. Person type columns require a peculiar format while Patching which I had blogged about. Give this a try and let me know - www.rezadorrani.com/index.php/2020/05/04/power-apps-patch-function-with-sharepoint/
@@RezaDorrani Cheers for the reply. I have updated the collection using the required format (i.e. claims..etc etc) and that update works fine. It's only when I try to do the bulk patch of newly updated collection to data source that it goes a bit funny. Will keep digging away here, but yeah it must be to do with the people column format. Cheers
Hi Reza, your video helps me a lot to progress my current work as it is in the same concept, but one help I will need from you- 1. I have used Nested Gallery for Phases and Tasks and they are working when I update them by selecting multiple checkboxes together but When I do Check All, It is Selecting all but not updating the Values. Please help me out with Check All and Uncheck All. Many Thanks in advance
Video description has link to download the solution file. (Please note its a solution zip file). You can install the solution and look at the code base.
Hi Reza! First off thanks for taking the time of doing these videos. They're amazing. I'm creating my first app using your videos. Honestly, without them, I would've been stuck. I do have a question though. When using this method patching a collection to a Dataverse table, I'm getting the error: The requested source does not support http method 'PATCH'. Do you know what might be going on? Thanks again!! Edit: I'm also getting this error: "Conflicts exist with changes on the server, please reload. Server response: scrubbedSensitiveData". Hope you can give me a hand on this!
So happy to hear that the videos are providing value. Thank you for watching them. My guess is your schema is not matching the data source and/or your item context is not matching the data source. I did this bulk update approach using a grid as well with dataverse. You can check it here - ruclips.net/video/8I0Pt_8I6k8/видео.html
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
Hi Reza, thanks for your sharing! I was wondering how did you set the select all button? I tried " set(variable, true)" on check but the colupdate could not collect data
Hi. Thank you for this really great turtorial! A follow up question: If a user uses the 'check all' function and afterwards wants to uncheck a few options (Example: lets say that there are 30 records and the user wants to check all except 2 items), this is not updated in the collection (Example: the collection still contains 30 records). Is it possible to change this?
Logic would need to be changed. When all is checked, then add all items to collection so that when an item is unchecked it is removed from the collection.
@@RezaDorrani Thanks for your reply! I am trying to do the bulk update. However, the value is not updated in dataverse. I have tried with different records. Do you have a suggestion why it is not patching? The 'update x records' indicates that there is a record in the collection. UpdateIf( ColUpdates; true; { 'Leverancegodkendelse retur': DatePicker_leverance.Value } );; Patch( Salgsobjekter; ColUpdates );; Notify( "Records Updated Successfully"; NotificationType.Success );; Clear(ColUpdates);; Set( varBulkUpdate; false );;Set(varCheckSelect;false)
@@majamller3589 Difficult to provide guidance here on chat without looking at your scenario in action. I would recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
Does my collection has to be exactly look like my data source? is that taken care when you created the collection on fly while checking the gallery items? Or do you have it initialized anywhere?
Hi Reza thank you for this video, the difference in performance using this method is quite amazing! Would you know if this method is limited to a certain number of rows? When I patch 50 rows, it uploads almost instantly, but if I patch 60 rows it takes 5 minutes. Just wondering if this is expected behaviour
It has to do with the threshold limits for the connector. You can make x calls per connector in a 60 sec duration. I'm guessing 50 might be the limit based on the connector your are using.
Hi Reza, is me again😛. I have post comment in one of your video clip yesterday asked about how do i use a button to allow select all/unselect all Checkboxes in Gallery. I am actually referring to your video PowerApps bulk update collection with Patch when i built the apps. My apps has a Gallery sourced from SP List, i added Checkbox to allow user select item(s) and update some fields in bulk. I refer to this video to set the Patch function and i saw in your video, the Gallery also has Checkbox and a button on top of Gallery allowed user to select/unselect all items from the Gallery. I tried to import the solution zip file but it doesn't work. Would you mind to guide me on how to set the Checkbox and the button for select/unselect all items? The Patch formula i followed exactly your example and i used the variables 'colUpdates' as well for the item selected from Gallery. Thank you!
Question is what issue are you getting when importing the solution. I have provided the entire solution for download :) Many have been able to use it successfully. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
@@RezaDorrani the error msg prompt when i tried to import the solution zip file, it says import canvas app created outside of a solution into this environment. I suspect because of my company policy where there are some restriction there. But ok, i will post in the forum, thanks.
I am getting the error of "invalid argument type (table). expecting a record value instead". Here is the code: Set( gbl_TimerStart, Now() ); ClearCollect( col_DatatoPatch, ShowColumns( col_Booking, "ID", "Title", "BookedDate", "BookedRoom", "BookedRoomName", "BookingStatus", "REQNum" ) ); Patch(BookingLineItems, col_DatatoPatch); SP List: Column (click to edit) Type Required Title Single line of text BookedDate Single line of text BookedRoom Number BookedRoomName Single line of text BookingStatus Number REQNum Single line of text Modified Date and Time Created Date and Time Created By Person or Group Modified By Person or Group Any idea why? TIA.
Great video as usual, when I am trying to import the solution as the canvas app, it gives an error (Import canvas app created outside of a solution into this environment. Apps created in a solution can be imported under Solutions) , any ideas for me , i am just a beginner
Reza, is it possible to automatic save collection to source when collection has certain ( ~10) records? I meant no button to press for update, when collection reaches to 10 records, it gets saved to source.
In this video I auto save based on a timer - ruclips.net/video/8I0Pt_8I6k8/видео.html You can easily check the number of records in a collection and push the updates. CountRows(collection)=10
This is great Reza! Quick question. How did you manage to update the collection with Gallery data when you use "Select All"? Though Select All check box is helping to check all the items in the gallery , but unable to update the records into collection. Appreciate your help. Thanks much!
Video description has link to download the solution. You can check the code base. From what I remember, Select All just reloads collection with all items.
Video description has link to download the solution. You can check the code base. From what I remember, Select All just reloads collection with all items.
Hello Reza, I'm trying to update records from gallery, It works fine for "CostCode", "Department","Description" , However the moment I start adding "Day1", "Day2", etc Powerapp starts giving me error, "Expecting a record value instead...", can you please help me with this? Here is my formula , Clear(CollToUpdate); ForAll( gallTimesheet.AllItems, Collect( CollToUpdate, { ID: Value(ThisRecord.ID), CostCode: txtCostCode.Text, Department: Value( lblDept.Text), Day1: Value(txtDay1.Text), Day2: Value(txtDay2.Text), Day3: Value(txtDay3.Text), Day4: Value(txtDay4.Text), Day5: Value(txtDay5.Text), Day6: Value(txtDay6.Text), Day7: Value(txtDay7.Text), Description:txtDescri.Text } ) ); Patch(Timesheet,ShowColumns(CollToUpdate, "ID", "CostCode", "Department","Description","Day1"))
Depends on column types, data source etc. Not possible to provide guidance here on chat without looking at your App and data source. I will recommend you post your issue with screenshots on the forums at powerusers.microsoft.com/
Hi Reza instead of checkbox we are using combobox and written collection onchange property with collect( colupdates,thisitem).and I used this in updateif onselect property but when I am changing multiple records every record is overwritten with same choice of combbox but not getting any error bulk update to sharepoint list.creating app in teams. Appreciate your response.But we are not getting any error to look and change. Thank you.
Hi Reza thanks for the great Video. I am just having an issue where when I add the check box to a gallerry. I can't check /uncheck it. What could be causing this I have changed the size and position of the labels in the gallery not to overlap the checkbox and even reordered the checkbox to the front and still can't check it.
You know I did face the same issue in a recent project as well. Looks like something must have changed with the remove formula. I got it to work another way too :)
Hi Reza ,How to reset checkbox inside gallery once bulk update happens? Not able to reset checkbox inside gallery as it is not creating collection and bulk update is also not happening. Could you please provide workaround.Appreciate your response.
Just empty the collection. If bulk update is not happening, then there must be some error in your case. Video description has link to download solution file. I will recommend you post your issue on forums to further deep dive into your issue - powerusers.microsoft.com/
Any good experience with using this method with an on-prem SQL connector? I had to create 1500 records on an on-prem SQL db but found this method rather slow. Took 3 minutes to complete. Now I am sending the collection as a JSON to Flow and using a stored procedure to get the records in de db. The flow takes 2 seconds to complete.
It would be difficult to track the issue in the chat. The description of this video has link to download the sample solution. You can check the exact code in the App.
@@sthanleyoliveira5300 I have exported just the App here - github.com/rdorrani/PowerApps/blob/master/BulkUpdates-CDS_20210407173055.zip Try and see if this works. This is best I can do at the moment.
Hi Reza, really great demo video. I would be totally willing to pay for a course taught by you. Just one question... i tried to import both Dataverse and CSD Bulkupdated files on my environment with no success. The firs one was not able to be imported and in the second one Task table has no data. Do you have any tip to solve it?. Thanks a lot in advance. Regards.
Solution imports do not contain data. So empty task table is as expected. What error are you getting while importing? You only need to import the solution file github.com/rdorrani/PowerApps/blob/master/BulkUpdatesDataverse_1_0_0_4.zip
@@RezaDorrani Thanks... finally i could import as solution with no data. I would like to replicate you example so i really appreciate if you could share an excel the data to populate the task table.
@@arlequin71 I keep updating my data for different use cases. My table hardly has an records now. To add sample data, just go to the Table in Dataverse, click edit in excel, and add your own sample data in there.
In collection we have Existing records and New Records added from PowerApps Screen. Now we want to do Bulk update for collection having exisiting and new records. How to do that?
So in order to patch the entire collection to a datasource like dataverse, all the columns in the collection have to match all the columns in the datasource(dataverse)?
Hi Reza, Thank you for the informative video and I really enjoy learning from your videos. I am experiencing an issue with bulk update operation. I have a Share point list 'Project Updates' and a collection colProjectUpdates with same columns. I am getting below error message "Invalid argument type (table), Expecting a record value instead". What am I missing? Could you please advise?
I will have to look at your App in action to provide any guidance. I would recommend you post your issue/query with screenshots on the forums at powerusers.microsoft.com
Hi Bidyut, I had this very issue. I finally find out I have a field with the same name but different types between the tables : 1 was number, the other one was text
I had again this issue, and it was not a problem of format of field. After hours of tests, I finally created new column/field in my sharepoint list, with shorter name (7 char instead of 19) and now it works fine. I'm not sure, but it seems related to the length of the column name ... Crazy !!!
Hi Reza, I Need help to slove one scenario, I have a collection it have multiple records and some records have attachment and some récord doesn't have attachment How i save and update all that above data in to sharepoint list. Please help me to slove this scenario.
Reza, I regret that I cannot give one million likes for this video. I have reduced the time it takes to save the entries to my SharePoint list right now from 2 minutes to just 6 seconds thanks to your video. And it took me less than 5 minutes to change the code. Thank you so much for your tutorial, it has been a great help!
Yes yes yes. So happy to hear that. Glad the video was helpful. I was running into a similar issue at my end and then I learnt about this technique.
Where were you all these years. I have been struggling with PowerApps and flow for bulk update. Thank you so much. I'll implement these changes ASAP.
You are most welcome. This was suggested to me by a subscriber :)
Reza, my search for a clear, conceptual instructor has ended. I have found a great mentor and teacher in you. You are awesome brother !
Wow, thank you!
Exactly what i needed to see right now. Thanks Reza. Official doc's are not covering these scenarios and even the blog you shared doesn't go beyond the speed aspects. Shame documentation or blogs aren't more available.
Thanks David. Sometimes the docs do not represent the true capabilities of a particular feature. I feel the bulk update technique using collections is a gem that many are not aware of.
Awesome, after struggling with several issues, it is always your video that provides the best solution.
Glad to help! Thanks for watching.
Reza, this is a godsend. It's brilliant how much time and performance you get by doing things the proper way.
Its all about the performance. Thanks for watching.
Outstanding Reza... please continue making these videos as they are pure gold
Thank you Richard. I will keep trying my best. If you have any suggestions do let me know.
Hi Reza
Thank you for taking the time to share your knowledge with us!
I have created a similar app with a bulk select feature, using Dataverse as a backend. Once records have been patched into the database (code of the On Select button being totally executed) , the gallery may take a few seconds to reflect the changes made.
In that case, end-user can still select an item in the gallery that looks brand new, and click update. Consequently, because the new database ID of the record is not yet showing in the gallery, a duplicate record is created upon patching.
And since there is no On Refresh event for galleries, it's difficult to know when the gallery reflects the changes made in the backend (refreshes are not synchronous).
I am sure you have already faced this use case, and I am curious to know how you are dealing with it. Thanks!
I have not faced the issue around duplicates.
Once user clicks submit button, you could always overlay a control over the grid which blocks user from making changes until the submit action is complete.
Valuable, valuable technique and tutorial. Thank you for your patience in developing this resource.
Thanks for watching this video. This video took a good amount of time to setup and build.
Thanks Reza! Really needed the performance enhancement you provided!!
Glad to hear that!
Hi Reza you are genie whenever i end up road block in power apps i search and always found a solution or you guided me to the same awesome content each and everyone of them
Genie at your service
For reference, if someone wants to use the ID of added items in this method, you do need to include the ID column in your collection, otherwise the ID won't be present in the returning collection. You can use Blank() as the value to add new items, the Patch return collection will include the correct ID value then.
Thanks for sharing!
Can you please be more specific though?will the Adding the primary action make it update instead of creating new item?
I want to duplicate the item with pre-defined values for primary key. Can you give me an advice?
Great Video.
Bulk operation is a must activity in PowerApps
Thank you. Let’s do bulk operations the right way :)
And thank you for suggesting the topic. Going by the initial response, this is a hot topic. Keep the suggestions flowing.
Great video and learning morning morning. I have implemented the collection technique for delete and update but never tried the copy / duplicate approach, good tip Reza!
Thanks Krishna. I learnt the copy technique by mistake. I forgot to include the primary key in my collection and noticed that it was creating items :)
@@RezaDorrani hmm... not bad! learning from mistakes and turned out to be a great video!
github.com/rdorrani/PowerApps/blob/master/BulkUpdatesDataverse_1_0_0_4.zip
Here is the link to the solution export.
@@RezaDorrani I'm getting this error while trying to upload the app package: "! Something went wrong. Please try again later". Does any one else is getting the same error? I've tried several times, same thing. P.S. Great video, thanks Reza!
@@Fernando_Calero Are you importing the zip as a solution file?
Hello Reza, I find your videos such a valuable resource. Thank you.
Appreciate the feedback. Thanks for following.
Reza, this is great and helps me to achieve better performance and make a lot of things easier. Thank you so much!
Great to hear! Thanks for watching.
Another awesome video Reza!!
Thanks :)
I have learnt a lot from your videos more than I have learnt in my 4 years of B.E... Reza, could you please create a video on how to create the view that is being presented in this video with the drop downs and buttons?
Thanks Revan.
I have a video on the view and dropdown filters with buttons - ruclips.net/video/Cu8pDo6WpRI/видео.html
@@RezaDorrani Thank you Reza. Have a good day!
oh waaow ..this technique help alot .Thanks so much Reza for a great tutorial
Glad it was helpful!
Reza, Amazing!! Just Amazing!! Thank you so much!!
Your most welcome!
Awesome video, just what I needed at this time👋
Glad to hear that! Thanks for watching Marc
Great video. Everything works at my side except for one thing. I am working with a SharePoint list called Pets. While copying records (creating New record), the lines
"ClearCollect(
colDataToPatch,
DropColumns(
colUpdates,
"ID"
)
);
Patch(
Pets,
colDataToPatch
); " Still give me the error "Network error when using the Patch function. Field 'Id' is required "
I will have to look at your App in action to provide guidance. I would recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
@@RezaDorrani I solved it by using the Showcolumns option in stead of Dropcolums. Showcolumns worked while Dropcolumns gave an error that ID was required. Huh???????? What ??????? How ??????? 🙂
@@wimjandan No idea! As long as it worked :)
Reza, superb video. Thank you very much !
Glad you liked it!
Hi, very informative video. Just one query. What is the formula for check all?
I showcased the check all feature steps in a different video. Here is the link ruclips.net/video/P6yqIpjmPrs/видео.html
@@RezaDorrani thank you so much
this is bloody amazing, I hope they have super like , thank you
You are most welcome. Well a super like would be a like and a sub :)
Thank you, this was extremely helpful!
You're very welcome!
You're the best Reza
Thank You 😊
Very Useful information Thank you!!
Glad it was helpful!
Absolutely love your videos! Learnt lots and saved me many hours. One question, How does your select all work? I can update the gallery item check boxes, but it doesn't add anything to the collection!! If I manually select a record or many it is added to the collection.
Thank You!
Video description has link to download the solution file (which includes the App). Its been a while I did this, so I don't exactly remember the Select All code.
Great tutorial!!..my long time search for a clear instructor has ended as you have consistently proved your expertise. Thank you Reza!!!
Thank you for your kind words
Hello Reza Dorrani, please could you share how you create a oncheck all items in a gallery, please ?
Thank you for share a lot of knowledge !!
I showcased it in a different video. Check ruclips.net/video/P6yqIpjmPrs/видео.html
Great video and thanks for explaining in details
Most welcome and thanks for watching
Thank you so much Reza, you are such a great teacher! Is is possible to use these methods to update the user to an empty or blank value for Sharepoint?
Thank You.
Possible to empty values. Here is the technique ruclips.net/video/fg-4nu_amJI/видео.html
@@RezaDorrani Thanks! Would I have to hardcode the empty value in the combobox? Using distinct does not give me an empty value.
@@rosariofalero9858 Yes, based on your scenario.
I will recommend to post your query with screenshots on the forums at powerusers.microsoft.com
Thank you Reza, another excellent video. In the past I have used Collect(Datasource, collection) instead of Patch(Datasource, Collection) for new items. What will the difference be?
It should work the same.
Thanks Reza great video. How would you implement error checking for the bulk add
IsEmpty(Errors(DataSource))
if true - then no errors
if false - then Errors(DataSource) will give you a table of records with all error details
@@RezaDorrani Thanks for your help
Hello Raza, Thank you so much for your videos. It helps me to update the logic you have built in the apps. Can you please share the video link for this end-to-end creation? I need exactly same scenario, I am unable to figure out multiple selection in check box and applying status change for the selected records.
I do not have an end to end video guide on this. If have tons of independent videos covering various concepts shown in this video.
Check my Power Apps playlist.
@@RezaDorrani Thanks Raza, for your reply.
This is awesome one. Thanks Reza
Most welcome and thanks for watching
Hi Reza, using your video I created a new app and it helped me so much thank you so much. I am using bulk patch just facing one issue of errors. I want to show success msg but only if there is no error. Tried multiple things but still having issue with error handling, do you have any video for that?
I do not have a video related to error handling. When you execute the Patch function, if you set a variable example: Set(varResult, Patch(...))
The variable will have all the details you need for error handling.
Hey Reza. Thank you for the great video. Can you please explain how did you create the "check all" button? No solution that i found worked for me.
Thank You.
Video description has link to download the solution file. It includes the App and all the code.
Reza, I’m using Sharepoint and I’m wanting to take a value in field 1 and duplicate that value into field 2 for each record. Each record will have a unique value in field 1, so am I still able to use the UpdateIf since it’s not an across the board all having a static value for all of them.
Thanks for your work!
Thanks for watching
@@RezaDorrani sorry Reza…Part of that was a question…Is UpdateIf a good method to use in the situation I described?
@@jray1429 Yes.
@@RezaDorrani I tried it and conquered!! Thank you, you’ve helped me multiple times - In multiple videos
Thank you so much!
Thanks for watching
Wonderful video @Reza Dorrani. Thanks for this. Appreciate if you can share the formula as I am getting error while importing the file from GitHub link that you shared.
Link is a solution file. Did you import as a solution?
@@RezaDorrani thanks for prompt reply. I was importing it as app. Sorry!
It's working perfectly with solution import 👍
Hi Reza, (UPDATING COMMENT TO REMOVE QUESTIONS I HAVE FIXED)
I had great success using your UpdateIf and Patch solution to bulk update a number of records in PowerApps.
I am now attempting to use the same solutions for a Power App embedded into a Power BI report as follows:
- Select Records in PowerBI
- Show Records in PowerBI Gallery using PowerBIIntegration
- I am able to copy a single record and update certain fields needed using the following (great!):
Patch(
kycPackageXclause, //Dataverse table
Defaults(kycPackageXclause),
{
kycPackageXclause_kycPackage: LookupKYCPackage.Selected,
kycPackageXclauseAppliesTo: ChoiceAppliesTo.Selected.Value,
kycPackageXclause_kycPackageRelatedParty: LookupRelatedParty.Selected,
kycPackageXclause_clause: LookupClause.Selected,
kycPackageXclause_jurisdictionStandard: LookupJurisdictionStandard.Selected,
kycPackageXclause_listOfValues: LookupListofValues.Selected
}
);
- I am now trying to achieve similar with multiple records,.
- I create a collection from the gallery
ClearCollect(KYCxCLCollection, GalleryPowerBIKYC.AllItems)
- I use a checkbox within the NewForm to indicate where a field needs to be updated with another value. The UpdateIf statement is being accepted
If(
CheckboxKycPackage.Value = true,
UpdateIf(
KYCxCLCollection,
true,
{'KYC Package Name': LookupKYCPackage_1.Selected.kycPackage}
)
);
- I create another collection from the initial collection but drop to IDs to ensure power Apps creates new records. This works fine!
ClearCollect(CopyMultipleKYCPackagesCollection, DropColumns(KYCxCLCollection, "crb8f_kycpackagexclauseid", "crb8f_kycpackagexclauseuid"));
- But the final Patch statement, recognises the source being my inital CDS table "kycPackageXclause" does not seem to like this new Collection I have just created "CopyMultipleKYCPackagesCollection" I guess because it is multiple records rather than just one?
Patch(kycPackageXclause, CopyMultipleKYCPackagesCollection)
I can't understand why this works in a straightforward PowerApp, but doesnt work for a PowerApp reading from PowerBI.
Any insight MOST HELPFUL, if you can understand everything I have written above!
Hi Laura,
I am working on a project that involves the Power Apps visual in Power BI and executing bulk update. Process is similar to yours.
What I do is based on items in the Power BI data set PowerBIIntegration.Data, I create my own collection using forall on PowerBIIntegration.Data. The column column names match the exact names in my data source. To get the base collection definition, I use defaults(Datasource).
@@RezaDorrani Hey Reza, I am trying your proposed method but still failing to get my Updated Collection to save back to the DataSource due to differences between the Record vs Table format of data.
This doesnt work......
Patch(collection,
Defaults(sourcetable),
{SourceField:CollectionField}));
I got round this by trying.......
Patch(collection,
Defaults(sourcetable),
{
SourceField: LookUp(sourcetable, sourcefield in [@Collection].crb8f_CollectionField)
}));
If the collection contains 4 records, all with different field content, the Patch will create 4 records, however all 4 records are crreated exactly the same, but the fields are populated based on the first record Power Apps finds in the Collection table (I guess because I am using the Lookup function)
This is the best way I can explain, it.
Collection Records
Record 1: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: Field updated by user so different from source data
Record 2: FieldA: 2a FieldB: 2b FieldC: 2c FieldD: Field updated by user so different from source data
Record 3: FieldA: 3a FieldB: 3b FieldC: 3c FieldD: Field updated by user so different from source data
Record 4: FieldA: 4a FieldB: 4b FieldC: 4c FieldD: Field updated by user so different from source data
New Records Required
Record 5: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: Field updated by user so different from source data
Record 6: FieldA: 2a FieldB: 2b FieldC: 2c FieldD: Field updated by user so different from source data
Record 7: FieldA: 3a FieldB: 3b FieldC: 3c FieldD: Field updated by user so different from source data
Record 8: FieldA: 4a FieldB: 4b FieldC: 4c FieldD: Field updated by user so different from source data
New Records Created
Record 5: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field
Record 6: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field
Record 7: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field
Record 8: FieldA: 1a FieldB: 1b FieldC: 1c FieldD: User defined field
Do I need to change when I trigger the ForAll loop or something?
Hi Reza, thanks a lot for sharing your knowledge in that way! Incredible and amazing method that you found (or create!) instead 'ForAll' to perform the bulk actions... I have a question: why does the Patch() function work with the collection if it expects a record? and in the same way, why does Patch() function update only three columns of the data source when the three columns collection is included as argument? Shouldn't be sent the data of the rest of columns like Defaulst()?... How does it work?... Thanks again!
The answer is in the documentation - docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-patch
Patch can do a lot more than just adding or updating a record.
Superb video Reza, thanks! I Learned so much from your tutorials. The direct patch from collection to sharepoint list works however as soon as I include a ForAll loop to add items to the collection before the Patch I get an error: Invalid argument type (Table). I expect some of the sharepoint list fields expect a record which I explicitly have to supply when creating new items. I know the whole point here is to avoid the ForAll but in my scenario I do want to add a few records before patching the collection to the sp list. Welcome any suggestions.
I will have to look at your App in action to provide guidance. I would recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
@@RezaDorrani Thanks Reza! In the meantime I have been able to resolve the issue.
@@Johanvanderschelling Great!
@@Johanvanderschelling i'm struggling with the same problem, could you please share your solution with me
Great video and learning
Thank you Sundra
Thanks for the excellent Video!
Your most welcome
thanks a lot and i have a question:Patch( DataSource, BaseRecordsTable, ChangeRecordTable1 [, ChangeRecordTable2, … ] ) , why in your video,only 2 without baserecordtable?
Because Patch also supports a collection as a parameter
Raza, I tried this operation using a "view" from a sql table (we use 3NF for all our tables...so we often create views to drive certain galleries in powerapps to avoid using "Lookup" func within a gallery). The view however, contains the Primary Key and other ID columns so we can easily work with patch functions, forms, etc.
For some reason, this seems to only work when the gallery items is the actual table, and not the view. When I hover over the error displayed over the Patch function it reads "Invalid argument type (Table), expecting a Record value instead". Should I be wrapping the collection in a First(Filter( function? Or will this only work when the gallery is connected to the actual table? Thank you in advance for your time! Awesome material!
Might be a limitation with a view. I have not tried it with views.
Hi! I'm having this issue. Do you remember if you were able to solve it? Thanks
Hi Reza. You reference the variable "varFilters" but you don't show where and how it's set. Could you please explain? Thanks for all the great learning content.
Video description has link to download the entire solution file. You can check the code base there.
Thanks alot.. How to add comment box for each record when changing the status?
I do not have a video reference on this scenario and would have to try it out to provide guidance. I recommend checking or posting your query on forums in case someone has done something similar powerusers.microsoft.com
Thanks alot for your reply. I will do post a question there :) @@RezaDorrani
Thank you, Reza, for another great video. I have dataverse for teams app and I want to duplicate entries. can we use the same method to copy records in dataverse for teams?
Yes you can!
Hey Reza, great video. You're a big help. Is it possible to select and patch the rows of one sharepoint list into a separate list?
Possible. Since you would be creating records in new list, you would need to ensure you do not include the primary key + list schemas need to match.
Thanks for your reply. More specifically, I am using a version of your paginated list gallery, except I have added a checkbox column and trying to perform the same function as in this video. When I try to patch the separate SharePoint list, however, it tells me it expects a record and not a table.
@@jacksonbender6478 I would have to look at your App in action to know the root cause of the issue. As per the error, looks like formula needs a collection (tabular) data but is being provided a record. I would recommend to post your issue with screenshots on the forums at powerusers.microsoft.com/
Turns out it was the list schema. Many thanks. Also, do you know of a way you can assign a unique ID to each row you select (patch) to the new SharePoint list?
@@jacksonbender6478 ID column is inbuilt in SharePoint and is read only.
This can help a lot for me. Power automate workflows keeps getting triggered two times in a row
I have not come across this issue hence not sure. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
Thanks for the video..
Most welcome
Hi Reza, thanks for the great video, I believe UpdateIf is not delegable, is there a workaround to remove multiple items that meet conditions in a delegable way?
Since we are working with collections, we need not worry about delegation. User will select items from gallery which is delegable and we are adding it to collection to update.
Thank you so much Reza also is there a way can you do a video for sales app please
My videos are more around how to leverage the Power Platform and I have done very few videos around specific Apps
How did you create the buttons in the gallery looks awesome? do you have a video link ?
Its a gallery that has the Choices of the Status column. I have not covered exactly this use case in a video. I am working on a video on creating Tabs in Power Apps. The technique is exactly the same as this.
Great video as always Reza. Will you address on a future video, inline editing on the gallery?
I like your suggestion and I will surely add it to my backlog.
Yes and here it is - ruclips.net/video/8I0Pt_8I6k8/видео.html
Great vid.
Thank you Simeon
Hi Reza, thanks for sharing your expertise on powerapps with the community! Your videos are tremendous help when I was creating my app. But I have a question. Is it possible to do a bulk create from canvas app to dataverse table? I tried doing a patch from a collection to dataverse table but it has a few errors such as "Patch function has invalid arguments" and "Name isn't valid. Description isn't recognized." Your help would be appreciated. Thanks!
Video shows how it works with Dataverse as well.
I will have to look at your App in action to provide guidance. I recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
Thanks so much Reza for a great tutorial!!! This is going to help tremendously. I have a follow up question though. My 'OnCheck' formula does not add records to the collection when I select all records by clicking on the 'Check All' button. It works fine when I check each box inside the gallery. Any thoughts? I'll greatly appreciate it. Thanks again! :-)
You are most welcome.
Check ruclips.net/video/P6yqIpjmPrs/видео.html for step by step explanation of the check all feature.
Thank you Reza for this video. Is it possible to patch duplicate records by defining x number from user. For e.g. is this video you are selecting number of records to duplicate but instead of selecting how can you patch let say user typed 8 times he/she needs to duplicate the records?
Possible. Get the number from the user and when Patching run it in a loop set by the user.
Hi,
Great video.
Is it possible to get the app in another form than a solution.
Within mine company imported solutions are not allowed.
Thanks in advance
Solution includes the supporting Tables in Dataverse which the App uses. Try creating a dev tenant for Office 365 and import the solution in there.
What is the code in the check all button. Looks like that part is skipped which was important to me.
Video description has link to download the solution file. ** Import it as a solution.
Reza thank you for the detailed explanation. I am stuck when i am trying to update dataverse with Lookup values. It works for update gallery existing records but cannot insert
ForAll(
Filter(
Gallery5.AllItems,
Toggle2_1.Value = true
),
Patch(
,
ThisRecord,
{
:ThisRecord.,
EmployeeId: ComboBox3.Selected
}
)
)
Glad it was helpful!
Hi Reza, Thank you for the Video, this gives a lot of information together to learn. I have implemented this in my Project work using SharePoint online everything is working but in one case - " I selected the records from Gallery, Every time I have selected more than two records but When I click on delete only 2 records being deleted rest selected records remain their in the gallery", Please suggest if any solution for this. Many Thanks in advance.
When u select records, then must be going into collection. Check if it has all selected records. It would be tough to guess what your issue is here on chat. I will recommend you post your issue with screenshots on the forums at powerusers.microsoft.com
Hi Reza - Another great video and was just dipping back into it to aid bulk updates as part of a doc management app I am building. I am noticing when I try to patch the entire collection following an update to a people field in the collection, the Patch formula doesn't like it when I try with just the collection. When I modify the formula to also include the column name i.e. Patch(source, collection.peoplecolumnname), the error disappears, but the patch doesn't work. Do you know if there are limitations with patching a full collection to a doc library and / or with people columns?
I have not tried with Person type column. Person type columns require a peculiar format while Patching which I had blogged about. Give this a try and let me know - www.rezadorrani.com/index.php/2020/05/04/power-apps-patch-function-with-sharepoint/
@@RezaDorrani Cheers for the reply. I have updated the collection using the required format (i.e. claims..etc etc) and that update works fine. It's only when I try to do the bulk patch of newly updated collection to data source that it goes a bit funny. Will keep digging away here, but yeah it must be to do with the people column format. Cheers
Hi Reza, your video helps me a lot to progress my current work as it is in the same concept, but one help I will need from you-
1. I have used Nested Gallery for Phases and Tasks and they are working when I update them by selecting multiple checkboxes together but When I do Check All, It is Selecting all but not updating the Values. Please help me out with Check All and Uncheck All. Many Thanks in advance
Video description has link to download the solution file. (Please note its a solution zip file).
You can install the solution and look at the code base.
@@RezaDorrani Thank you
Hi Reza! First off thanks for taking the time of doing these videos. They're amazing. I'm creating my first app using your videos. Honestly, without them, I would've been stuck. I do have a question though. When using this method patching a collection to a Dataverse table, I'm getting the error: The requested source does not support http method 'PATCH'. Do you know what might be going on? Thanks again!!
Edit: I'm also getting this error: "Conflicts exist with changes on the server, please reload. Server response: scrubbedSensitiveData". Hope you can give me a hand on this!
So happy to hear that the videos are providing value. Thank you for watching them.
My guess is your schema is not matching the data source and/or your item context is not matching the data source.
I did this bulk update approach using a grid as well with dataverse. You can check it here - ruclips.net/video/8I0Pt_8I6k8/видео.html
Hello thank you for you help, when I try copy, field id is required
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
Hi Reza, a quick question for you: can we do this to SharePoint list? Thanks.
Yes. I have done that in a project of mine. Key is to ensure your collection schema matches your list schema.
Great video. Will this also work with SQL?
This video was inspired from a project I am working on with SQL :)
Answer is Yes
Hi Reza, thanks for your sharing! I was wondering how did you set the select all button? I tried " set(variable, true)" on check but the colupdate could not collect data
It has been a long while since I did this video and hence do not remember the specifics.
Video description has link to download solution.
Hi. Thank you for this really great turtorial! A follow up question: If a user uses the 'check all' function and afterwards wants to uncheck a few options (Example: lets say that there are 30 records and the user wants to check all except 2 items), this is not updated in the collection (Example: the collection still contains 30 records). Is it possible to change this?
Logic would need to be changed. When all is checked, then add all items to collection so that when an item is unchecked it is removed from the collection.
@@RezaDorrani Thanks for your reply! I am trying to do the bulk update. However, the value is not updated in dataverse. I have tried with different records. Do you have a suggestion why it is not patching? The 'update x records' indicates that there is a record in the collection.
UpdateIf(
ColUpdates;
true;
{
'Leverancegodkendelse retur': DatePicker_leverance.Value
}
);;
Patch(
Salgsobjekter;
ColUpdates
);;
Notify(
"Records Updated Successfully";
NotificationType.Success
);;
Clear(ColUpdates);;
Set(
varBulkUpdate;
false
);;Set(varCheckSelect;false)
@@majamller3589 Difficult to provide guidance here on chat without looking at your scenario in action. I would recommend posting your issue/query with screenshots on the forums at powerusers.microsoft.com
Does my collection has to be exactly look like my data source? is that taken care when you created the collection on fly while checking the gallery items? Or do you have it initialized anywhere?
It is taken care of when I add the record to the Collection on check in the gallery. No initialization required.
Hi Reza thank you for this video, the difference in performance using this method is quite amazing! Would you know if this method is limited to a certain number of rows? When I patch 50 rows, it uploads almost instantly, but if I patch 60 rows it takes 5 minutes. Just wondering if this is expected behaviour
It has to do with the threshold limits for the connector. You can make x calls per connector in a 60 sec duration. I'm guessing 50 might be the limit based on the connector your are using.
Hi Reza can you share the code that you use in Button (check all ) to select all the individual text boxes
Video description has link to download sample solution. All the code is in it.
how select all checks all checkbox and patch ,code shared in github is not able to comprehend,could you please add code below .Appreciate your answer.
The App is shared in github.
Set(
varCheckSelect,
!varCheckSelect
);
If(
varCheckSelect,
ClearCollect(
colUpdates,
If(IsBlank(varFilter),Tasks, Filter(Tasks,'Task Status' = varFilter))
),
Clear(colUpdates)
)
Hi Reza, is me again😛. I have post comment in one of your video clip yesterday asked about how do i use a button to allow select all/unselect all Checkboxes in Gallery. I am actually referring to your video PowerApps bulk update collection with Patch when i built the apps. My apps has a Gallery sourced from SP List, i added Checkbox to allow user select item(s) and update some fields in bulk. I refer to this video to set the Patch function and i saw in your video, the Gallery also has Checkbox and a button on top of Gallery allowed user to select/unselect all items from the Gallery. I tried to import the solution zip file but it doesn't work. Would you mind to guide me on how to set the Checkbox and the button for select/unselect all items? The Patch formula i followed exactly your example and i used the variables 'colUpdates' as well for the item selected from Gallery. Thank you!
Question is what issue are you getting when importing the solution. I have provided the entire solution for download :)
Many have been able to use it successfully.
I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
@@RezaDorrani the error msg prompt when i tried to import the solution zip file, it says import canvas app created outside of a solution into this environment. I suspect because of my company policy where there are some restriction there. But ok, i will post in the forum, thanks.
@@leeseankoay8691 Error message says to import canvas app? Confusing.
Best to post the issue on the forums.
@@RezaDorrani exactly...but anyway, i hv post the issue in the forum, link per above
I am getting the error of "invalid argument type (table). expecting a record value instead".
Here is the code:
Set(
gbl_TimerStart,
Now()
);
ClearCollect(
col_DatatoPatch,
ShowColumns(
col_Booking,
"ID",
"Title",
"BookedDate",
"BookedRoom",
"BookedRoomName",
"BookingStatus",
"REQNum"
)
);
Patch(BookingLineItems, col_DatatoPatch);
SP List:
Column (click to edit) Type Required
Title Single line of text
BookedDate Single line of text
BookedRoom Number
BookedRoomName Single line of text
BookingStatus Number
REQNum Single line of text
Modified Date and Time
Created Date and Time
Created By Person or Group
Modified By Person or Group
Any idea why? TIA.
I have not come across this issue hence not sure. I recommend posting your issue with screenshots on the forums at powerusers.microsoft.com
Great video as usual, when I am trying to import the solution as the canvas app, it gives an error (Import canvas app created outside of a solution into this environment. Apps created in a solution can be imported under Solutions) , any ideas for me , i am just a beginner
You have to upload the zip file as a solution under the solutions tab
Reza, is it possible to automatic save collection to source when collection has certain ( ~10) records? I meant no button to press for update, when collection reaches to 10 records, it gets saved to source.
In this video I auto save based on a timer - ruclips.net/video/8I0Pt_8I6k8/видео.html
You can easily check the number of records in a collection and push the updates.
CountRows(collection)=10
This is great Reza! Quick question. How did you manage to update the collection with Gallery data when you use "Select All"? Though Select All check box is helping to check all the items in the gallery , but unable to update the records into collection. Appreciate your help. Thanks much!
I have the same doubt
Video description has link to download the solution. You can check the code base.
From what I remember, Select All just reloads collection with all items.
Video description has link to download the solution. You can check the code base.
From what I remember, Select All just reloads collection with all items.
@@RezaDorrani Would it be this?
If (VarCheck = true; Set (VarCheck; false); Set (VarCheck; true))
@@RezaDorrani The solution is not being compatible, I already tried to import
Hi Reza, Good evening . I want to understand the way of creating bulk new records into sharepoint with single button in power app with patch command ?
This video showcases exactly that. Create a collection, schema should match SP list, remove the primary key column (ID) and then patch the collection.
Hello Reza, I'm trying to update records from gallery, It works fine for "CostCode", "Department","Description" , However the moment I start adding "Day1", "Day2", etc Powerapp starts giving me error, "Expecting a record value instead...", can you please help me with this? Here is my formula ,
Clear(CollToUpdate);
ForAll(
gallTimesheet.AllItems,
Collect(
CollToUpdate,
{
ID: Value(ThisRecord.ID),
CostCode: txtCostCode.Text,
Department: Value( lblDept.Text),
Day1: Value(txtDay1.Text),
Day2: Value(txtDay2.Text),
Day3: Value(txtDay3.Text),
Day4: Value(txtDay4.Text),
Day5: Value(txtDay5.Text),
Day6: Value(txtDay6.Text),
Day7: Value(txtDay7.Text),
Description:txtDescri.Text
}
)
);
Patch(Timesheet,ShowColumns(CollToUpdate, "ID", "CostCode", "Department","Description","Day1"))
Depends on column types, data source etc.
Not possible to provide guidance here on chat without looking at your App and data source.
I will recommend you post your issue with screenshots on the forums at powerusers.microsoft.com/
@@RezaDorrani ok, will do that, Thank you!
hi Reza could please write code how to pass check all to check box in gallery and patch and same for unpatch.
Appreciate your answer.
Set(
varCheckSelect,
!varCheckSelect
);
If(
varCheckSelect,
ClearCollect(
colUpdates,
If(IsBlank(varFilter),Tasks, Filter(Tasks,'Task Status' = varFilter))
),
Clear(colUpdates)
)
Hi Reza instead of checkbox we are using combobox and written collection onchange property with collect( colupdates,thisitem).and I used this in updateif onselect property but when I am changing multiple records every record is overwritten with same choice of combbox but not getting any error bulk update to sharepoint list.creating app in teams.
Appreciate your response.But we are not getting any error to look and change.
Thank you.
I would have to look at your code to comment on this.
Would be best if you post your issue with screenshots on the forums at powerusers.microsoft.com/
Hi Reza thanks for the great Video.
I am just having an issue where when I add the check box to a gallerry.
I can't check /uncheck it.
What could be causing this I have changed the size and position of the labels in the gallery not to overlap the checkbox and even reordered the checkbox to the front and still can't check it.
I think I figured it out it was because I was using a scrollable screen and I don't think I had the gallery infront of the canvas.
Check the order of the controls.
Great!
when i give remove(datasource, collection) it says the second argument has to be a record and it does not work?
edit: got it to work another way.
You know I did face the same issue in a recent project as well. Looks like something must have changed with the remove formula.
I got it to work another way too :)
Hi Reza ,How to reset checkbox inside gallery once bulk update happens? Not able to reset checkbox inside gallery as it is not creating collection and bulk update is also not happening. Could you please provide workaround.Appreciate your response.
Just empty the collection. If bulk update is not happening, then there must be some error in your case. Video description has link to download solution file.
I will recommend you post your issue on forums to further deep dive into your issue - powerusers.microsoft.com/
Hi I was wondering if there is way to edit and save the person field inside a gallery
Possible. For that you need to build gallery as an editable grid. I have done a few videos on grids on my channel.
Any good experience with using this method with an on-prem SQL connector? I had to create 1500 records on an on-prem SQL db but found this method rather slow. Took 3 minutes to complete. Now I am sending the collection as a JSON to Flow and using a stored procedure to get the records in de db. The flow takes 2 seconds to complete.
I have not tried it with on-premises scenarios.
Hi Reza,
Can we do bulk update in SharePoint list with a condition in Powerapps
Can be done. Filter the collection based on your condition and patch that.
The 'select all' button sets the checkbox in the gallery on true, but the collection does not update.
Could you explain me what I do wrong?
It would be difficult to track the issue in the chat. The description of this video has link to download the sample solution. You can check the exact code in the App.
I have the same problem, I could send the code you used here below, because I'm not able to open the solution you put in the link.
@@sthanleyoliveira5300 I have exported just the App here - github.com/rdorrani/PowerApps/blob/master/BulkUpdates-CDS_20210407173055.zip
Try and see if this works. This is best I can do at the moment.
Hi Reza, really great demo video. I would be totally willing to pay for a course taught by you.
Just one question... i tried to import both Dataverse and CSD Bulkupdated files on my environment with no success. The firs one was not able to be imported and in the second one Task table has no data. Do you have any tip to solve it?. Thanks a lot in advance. Regards.
Solution imports do not contain data. So empty task table is as expected.
What error are you getting while importing? You only need to import the solution file github.com/rdorrani/PowerApps/blob/master/BulkUpdatesDataverse_1_0_0_4.zip
@@RezaDorrani Thanks... finally i could import as solution with no data. I would like to replicate you example so i really appreciate if you could share an excel the data to populate the task table.
@@arlequin71 I keep updating my data for different use cases. My table hardly has an records now. To add sample data, just go to the Table in Dataverse, click edit in excel, and add your own sample data in there.
In collection we have Existing records and New Records added from PowerApps Screen.
Now we want to do Bulk update for collection having exisiting and new records.
How to do that?
As long as the primary column of table is present and has a matching value in database, it will update item else create item.
So in order to patch the entire collection to a datasource like dataverse, all the columns in the collection have to match all the columns in the datasource(dataverse)?
Yes. Same concept works with other data sources as well.
Hi Reza,
Thank you for the informative video and I really enjoy learning from your videos.
I am experiencing an issue with bulk update operation. I have a Share point list 'Project Updates' and a collection colProjectUpdates with same columns. I am getting below error message
"Invalid argument type (table), Expecting a record value instead". What am I missing? Could you please advise?
I will have to look at your App in action to provide any guidance. I would recommend you post your issue/query with screenshots on the forums at powerusers.microsoft.com
Hi Bidyut,
I had this very issue. I finally find out I have a field with the same name but different types between the tables : 1 was number, the other one was text
I had again this issue, and it was not a problem of format of field. After hours of tests, I finally created new column/field in my sharepoint list, with shorter name (7 char instead of 19) and now it works fine. I'm not sure, but it seems related to the length of the column name ... Crazy !!!
@@denis7369 Glad to know it worked.
Hi Reza,
I Need help to slove one scenario,
I have a collection it have multiple records and some records have attachment and some récord doesn't have attachment
How i save and update all that above data in to sharepoint list.
Please help me to slove this scenario.
Collections with attachments cannot be Patched to SharePoint using this technique.
Patch does not support attachments.