Using Power Apps Patch to Insert and Update (with People Pickers and Choice columns)

Learn how to use Power Apps Patch to update or insert into a SQL Server table or in this case, a SharePoint list. Brian also covers how to update into special data types like Choice and People Pickers
Pragmatic Works training: www.pragmaticworks.com
Update Statement:
Patch('Assembly Work Orders', ThisItem, {'Text Status':"Complete",
Status:
{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Value:"Complete"},
Owner:{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Department: "",
Claims: "i:0#.f|membership|" & User().Email,
DisplayName: User().FullName,
Email: User().Email,
JobTitle: "",
Picture: ""
}
})
Insert Done with the Defaults() command:
Patch(
'Assembly Work Orders',
Defaults('Assembly Work Orders'),
{
Title: dcTitle.Text,
'Work Order Number':Value(dcvWorkOrderNumber.Text),
ProductImage: dcProductImage.Text,
Status: ddStatus.Selected
}
)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - -
Next step on your journey:
👉 On-Demand Learning Courses FREE Trial: www.pragmaticworkstraining.co...
🔗Pragmatic Works On-Demand Learning Packages: pragmaticworks.com/pricing/
🔗Pragmatic Works Boot Camps: pragmaticworks.com/boot-camps/
🔗Pragmatic Works Hackathons: pragmaticworks.com/private-tr...
🔗Pragmatic Works Virtual Mentoring: pragmaticworks.com/virtual-me...
🔗Pragmatic Works Enterprise Private Training: pragmaticworks.com/private-tr...
🔗Pragmatic Works Blog: blog.pragmaticworks.com/
Let's connect:
✔️Twitter: / pragmaticworks
✔️Facebook: / pragmaticworks
✔️Instagram: / pragmatic.works
✔️LinkedIn: / pragmaticworks
✔️KZread: / pragmaticworks
Pragmatic Works
7175 Hwy 17, Suite 2 Fleming Island, FL 32003
Phone: (904) 413-1911
Email: training@pragmaticworks.com

Пікірлер: 24

  • @mcrimpin
    @mcrimpin2 жыл бұрын

    Great video. This was a life saver with dealing with special types of data in SharePoint list. Thanks so much!!!

  • @claudeuu2
    @claudeuu28 ай бұрын

    An amazing tutorial that saved me a ton of work, thank you Brian!

  • @Steve.Outdoors
    @Steve.Outdoors Жыл бұрын

    Just what I need thank you was racking my brains on this one but you explanation was so easy to follow and understand

  • @blazehawkins2759
    @blazehawkins27592 жыл бұрын

    Thank you so much Brian! Your teaching style is phenomenal, and I learn so much. I might literally owe my job to your videos!

  • @PragmaticWorks

    @PragmaticWorks

    2 жыл бұрын

    Fantastic! Thanks for the comment. - Brian

  • @aboubacarsidikinabe7611
    @aboubacarsidikinabe7611 Жыл бұрын

    Thank you. You saved me.

  • @victorfarinella4055
    @victorfarinella40552 жыл бұрын

    You really made possible an app that I worked all day to solve! Thank you so much!

  • @PragmaticWorks

    @PragmaticWorks

    2 жыл бұрын

    Glad I could help!

  • @NIKUNJPATEL-si1ep
    @NIKUNJPATEL-si1ep2 жыл бұрын

    Thank you, sir. Awesome.

  • @bernarat
    @bernarat Жыл бұрын

    Great video! How do you patch if your people picker allows for multiple selection?

  • @tenebrae1191
    @tenebrae11912 жыл бұрын

    👏

  • @saradehond3293
    @saradehond32932 жыл бұрын

    You explain it so great!! Does the Patch within the gallery to the left also work for images? Like connection to an add image control?

  • @PragmaticWorks

    @PragmaticWorks

    2 жыл бұрын

    It depends on where you put the OnSelect code. In most cases, you'd be able to click anywhere in that cell if you use the default scenario.

  • @derekgray3019
    @derekgray30192 жыл бұрын

    Fairly easy for me to follow for a beginner and never done any 'Patch' functions before in my forms. I do have a question though, as I want to patch update from the form control with the selected persons name from a people picker to update the SP list item 'Assetowner' (this is a people picker in the SP list), as this is form a form, am i still required to use the 'Thisitem' after the SP list name (Assets) or specify the actual choice column name, which is 'AssetOwner'?

  • @PragmaticWorks

    @PragmaticWorks

    2 жыл бұрын

    Hi Derek, check out this cheat sheet I wrote that hs the SharePoint variants near the bottom of it: pragmaticworks.com/resources/cheat-sheets/power-apps-cheat-sheet-page/ I think it answers that question for you. Brian

  • @derekgray3019

    @derekgray3019

    2 жыл бұрын

    @@PragmaticWorks Hi Brian, thank you for your prompt reply to my query and thank you for the link to the cheat sheet. Just to extend my question a bit further, what if I wanted to patch the name of the person that I selected from the Office365users connection using a people picker that I created from a tutorial by April Dunham kzread.info/dash/bejne/hYZ_qsivZLu_eqg.html. April's tutorial does not show how to pass the DisplayName value into the AssetOwner choices item in the SP list. I thought I could reference the same variable that displays the name of the selected person. This is why I thought a Patch function could deal with this scenario. I've tried various ways but unsuccessful. I would add screen captures to show my use case to help with context, but not able to in KZread comments :-)

  • @anisamira2949
    @anisamira29498 ай бұрын

    Hi, I noticed that when you update the Status, it will automatically update in the SPL? How did you do that? Thank you.

  • @janurbanek1127
    @janurbanek1127 Жыл бұрын

    Hi Brian, Great video. Would you know how to patch choice column with multiple choice enabled? Lets say you assign things to departments and you want to be able to assign it to multiple departments?

  • @PragmaticWorks

    @PragmaticWorks

    Жыл бұрын

    Are you thinking of a choices field? If so you have to pack fields into a curly brace to accomplish that and pass int he fields that were selected. Patch(‘Employee Information’,Defaults(‘Employee Information’),{Title:”test Choice”,’Job Title’:Dropdown1.Selected})

  • @lih1009
    @lih1009 Жыл бұрын

    Thanks so much!!! It was just what I, too, needed! How can I clear the value from the person field? (Owner)

  • @lih1009

    @lih1009

    Жыл бұрын

    I managed to do that: Patch('Main Table', BrowseGallery1.Selected,{CurrentlyUsedBy: Blank()})

  • @SoNonWoo
    @SoNonWoo Жыл бұрын

    I have a very similar app but it is formatted for a phone instead of a tablet. Because of the smaller form factor, I've elected to pass the data from a gallery to an edit form on another screen where I have run into a problem. It does not allow for "ThisItem". What do I do? The edit form auto-populates with Gallery.Selected.

  • @minvisusanpaul2212
    @minvisusanpaul2212 Жыл бұрын

    Hello, may i know how will i get data type of lookup.. Mine data sourcw is Microsoft dataverse table

  • @user-ks6dt4xj5k
    @user-ks6dt4xj5k Жыл бұрын

    cant see the code in description.