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

People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

I used this piece of patch code on another page in my app. Works perfectly fine.

For a similar person field I want to patch this piece of code, not sure why it throws this rather weird error.

Any ideas to where I'm going wrong?

 

Screenshot (44)_LI.jpg

8 REPLIES 8
Dual Super User
Dual Super User

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

Hey @qfatima 

 

I see all the fields as empty, and as per the error, the person is not found. This means you have to pass correct details about the user/person. As a different approach to this, you can use the Choices() function to patch the result as:

If this is a multiselect person field

Patch(DataSource, First(Filter(DataSource, Col1 = "Value1")),{ Title:"Title Value", FieldServiceSME: Filter(Choices(DataSource.FieldServiceSME), DisplayName = "NametoSearch")})

If this is a single select person field.

Patch(DataSource, First(Filter(DataSource, Col1 = "Value1")),{ Title:"Title Value", FieldServiceSME: LookUp(Choices(DataSource.FieldServiceSME), DisplayName = "NametoSearch")})

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

qfatima
Level: Powered On

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

I have the exact same piece of code (for the same SharePoint list, within the same app) for patching selected person(s) on a form to the SharePoint list. I also read other blogs where patching based on empty values is allowed. Couldn't yet figure out why this error on this page. 

 

Also, I checked your suggestion:

Patch('Bid Management_1', First(Filter('Bid Management_1',Title = EditRecord.Title)),
{
    Title:"FieldServicesSME",
    FieldServicesSME:
    Filter(Choices('Bid Management_1'.FieldServiceSME), DisplayName = NamePicker.Selected.DisplayName)})

Error attached - thanks!

 

Community Support Team
Community Support Team

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

Hi @qfatima ,

 

Did you mean that you want to leave this person and group field blank when patching items to SharePoint list? If so, then you just need to not include this field in Patch formula. Like:

Patch('Bid Management_1', First(Filter('Bid Management_1',Title = EditRecord.Title)),
{
    Title:"FieldServicesSME"}
)

Regards,

Mona 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
qfatima
Level: Powered On

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

Hi Mona,

 

Not quite. When I patch, I want the person's name to be updated/populated on a SharePoint list person column.

I wrote a similar function in another page: 

PowerAppsPeople.png

 

Which upon saving with other details of the form creates a record like this on my SharePoint list (Quamar Fatima Person is added to Notify Installation Column): 

 

PowerAppsSharePointPeople.png

 

Very strangely when I write a very similar piece of code on a different form for a similar patch on the same SharePoint list Multi-person column, it throws an error that resource is not found. Snippet of code and error on the 2nd patch function: 


Screenshot (44)_LI.jpg

Dual Super User
Dual Super User

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

Hi @qfatima 

 

Can you ensure that the choices columns has the correct arguments?

Choices(EntityyouWantToPatch.ColumnNameinEntity)

For more details please refer: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-choices 

If this is a person type field, the attribute name is "DisplayName", you can use PowerApps Intellisense to get the correct names.

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

qfatima
Level: Powered On

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

Hi @yashag2255  and @v-monli-msft

 

Thank you for your replies. 

I still find it difficult to wrap my head around the concept of patching people.

Below, I have 2 people fields in the form: EstimatingSME and InstallationSME.

InstallationSME patches along with SubmitForm (I have not written any extra code)

and I wrote a patch function for EstimatingSME (which btw is similar to the code I have written else for patching a person and it works). But this EstimatingSME does not work. 

 

peoplepatch.png

 

 

I'm probably really newbie (and confused-bee if that's a word) to this, any leads appreciated!

qfatima
Level: Powered On

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

After some trial and error, I learned that we don't have to patch any values while submitting SharePoint list names in a form. 

However, if I have a defaulted user on a column (I had Office365Users.MyProfile()) as default, and in this case it did not patch the user. 

Community Support Team
Community Support Team

Re: People picker Patch function - The specified user is invalid: Server Response: Specified user could not be found

Hi @qfatima ,

 

Patch formula for person and group field should be something like:

{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
        Claims:"i:0#.f|membership|michael@wiXXXX.onmicrosoft.com",
    Department:"",
   DisplayName:"Michael Shao",
         Email:"Michael@wiXXXX.onmicrosoft.com",
      JobTitle:"",
       Picture:""
   }

 

You could have a look at below thread:

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

 

Regards,

Mona

 

 

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

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 141 members 5,380 guests
Recent signins:
Please welcome our newest community members: