cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Gayathri_TU
Helper II
Helper II

Patch a Person column from a collection (Repeating table)

Hi,

Re-posting again.

Can you please help me through , how to patch person column from power apps collection to SharePoint

 

After every row i use this code to patch value to collection and works fine:patch 1.PNG

when i try to patch value from collection to share point list , i am getting the following error,

patch 3.PNG

Owner Name - SharePoint list Person or group column

 

Error Screenshot,

error.PNG

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
DevendraSingh
Resolver I
Resolver I

Hi,

Replace the below query in your formula,

'Owner Name':{Claims:"i:0#.f|membership|devendra.singh@test.com", Department:"", Email:"devendra.singh@test.com", DisplayName:"Devendra Singh", JobTitle:"", Picture:""}

Change the email address and display name with your data.

Please click Accept as Solution, if this solution solved your issue. If this post was useful, please consider giving it Thumbs Up.


Thanks & Regards,

Devendra Singh

 

View solution in original post

4 REPLIES 4
DevendraSingh
Resolver I
Resolver I

Hi,

Replace the below query in your formula,

'Owner Name':{Claims:"i:0#.f|membership|devendra.singh@test.com", Department:"", Email:"devendra.singh@test.com", DisplayName:"Devendra Singh", JobTitle:"", Picture:""}

Change the email address and display name with your data.

Please click Accept as Solution, if this solution solved your issue. If this post was useful, please consider giving it Thumbs Up.


Thanks & Regards,

Devendra Singh

 

v-yutliu-msft
Community Support
Community Support

Hi @Gayathri_TU ,

Is Owner Name the person value?

Does this column allow multiple value?

Please notice the structure of person field.

1)single person field:

{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        Claims:"i:0#.f|membership|emailaddress",
    Department:"",
   DisplayName:"fullname",
         Email:"emailaddress",
      JobTitle:"",
       Picture:""
   }

2)multiple person field:

Table({'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        Claims:"i:0#.f|membership|emailaddress",
    Department:"",
   DisplayName:"fullname",
         Email:"emailaddress",
      JobTitle:"",
       Picture:""
   }
)

 

So to update person field, you also need to know that person's email address.

1)single person field:

 

ForAll(Subaction,
       If(!IsBlank(Title),
       Patch(....,
             ...,
            {..........,
              'Owner Name':
              {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims:"i:0#.f|membership|emailaddress",
               Department:"",
               DisplayName:name,
                Email:"emailaddress",
                 JobTitle:"",
                 Picture:""
               }
              }
         )
)
   }

 

//please replace emailaddress with that user's email

 

2)multiple person field:

 

ForAll(Subaction,
       If(!IsBlank(Title),
       Patch(....,
             ...,
            {..........,
              'Owner Name':
              Table(
                  {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
                Claims:"i:0#.f|membership|emailaddress",
               Department:"",
               DisplayName:name,
                Email:"emailaddress",
                 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.
DBJ
Helper I
Helper I

Hi @Gayathri_TU ,

 

I'm doing something similar and curious what you set for the DefaultSelectedItems or Default of the person field in the form so that the name remains in the previous row when you add a row?

kmw1130
Post Partisan
Post Partisan

I'm having a similar issue, but your examples are manually entering the user (email), I a using a combo box for the person to select a user and then Patch and do the ForAll.  If I add a different user into the next repeating table, when I Patch and do the ForAll, the first user is not saved, it saves the 2nd one that was added.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (3,842)