cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
DA4
Level: Powered On

Patch a Person to single Sharepoint row

Hello everbody,

 

today I have a question for you regarding the Patch-function. I want to add a person (Office365 Account) to an single row.

The table contains an ID and the person.

Patch(SeatPlanReservation; First(Filter(ReservationPlan;Titel="0101")); { Reservation: Office365-User.MyProfile() })

But the last entry wont work. (Office365-User.MyProfile()) I allready tried to get my User (Person) with .UserProfile(User().Email)!

The error message said, that the record wouldn't work, because PowerApps or the Sharepoint List is using an other value.

 

I never worked with records, any ideas? I just want to put the Office365-Account to the list. The user will always be the logged user of the using powerapp.

 

Best regards and thank you

 

DA4

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Patch a Person to single Sharepoint row

Hi @DA4 ,

It's not supported to use "Office365-User.MyProfile()" directly to update person field.

Here are two ways to update person field:

1)use combo box

set the combo box's Items:

Choices(SeatPlanReservation.Reservation)

choose your account in the combo box.

Then try this fomula:

 

Patch(SeatPlanReservation; First(Filter(ReservationPlan;Titel="0101")); { Reservation: combo box1.Selected })

 

2)use formula to update

Try this:

Patch(SeatPlanReservation; 
      First(Filter(ReservationPlan;Titel="0101")); 
      { Reservation: 
            {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
              Claims:"i:0#.f|membership|"& User().Email,
               Department:"",
               DisplayName:User().FullName,
               Email:User().Email,
               JobTitle:"",
               Picture:""
              }
         }
     )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Dual Super User
Dual Super User

Re: Patch a Person to single Sharepoint row

Take a look at the solution in the following thread:

https://powerusers.microsoft.com/t5/Building-Power-Apps/Saving-data-from-powerapps-to-SP-lists-perso...

To patch a person object to SharePoint you have to supply the values in a particular format.  You can get the values you need from the profile object, but you can't save it directly.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Community Support Team
Community Support Team

Re: Patch a Person to single Sharepoint row

Hi @DA4 ,

It's not supported to use "Office365-User.MyProfile()" directly to update person field.

Here are two ways to update person field:

1)use combo box

set the combo box's Items:

Choices(SeatPlanReservation.Reservation)

choose your account in the combo box.

Then try this fomula:

 

Patch(SeatPlanReservation; First(Filter(ReservationPlan;Titel="0101")); { Reservation: combo box1.Selected })

 

2)use formula to update

Try this:

Patch(SeatPlanReservation; 
      First(Filter(ReservationPlan;Titel="0101")); 
      { Reservation: 
            {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
              Claims:"i:0#.f|membership|"& User().Email,
               Department:"",
               DisplayName:User().FullName,
               Email:User().Email,
               JobTitle:"",
               Picture:""
              }
         }
     )

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

DA4
Level: Powered On

Re: Patch a Person to single Sharepoint row

Thanks for your help! Works excellent!  👍

Helpful resources

Announcements
thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (5,398)