cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DBJ
Helper I
Helper I

'Specified user i:0#.f|membership| could not be found" while trying to patch to SP list but value still gets patched

 

I'm getting an error of "specified user i:0#.f|membership| could not be found" while patching a collection value to SharePoint list but value still gets patched correctly to the list.

 

Any ideas? 

 

Error:

DBJ_3-1592946034869.png

 

Patching statement 

DBJ_2-1592945950376.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @DBJ ,

Could you please share a bit more about the "OfficerNameCol1" variable? Does it store the display name of the user?

 

Based on the formula that you mentioned, I think there is something wrong with it. The value provided for the Claims attribute should contains the email address of the user rather than Display Name. The standard value format for the Claims attribute should be as below:

"i:0#.f|membership|user1@email.com" 

 

On your side, please consider modify your formula as below:

{
  'Officer Name': {
     Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUserV2().value, DisplayName = OfficerNameCol1).Mail),
     DisplayName: OfficerNameCol1,
     Email: LookUp(Office365Users.SearchUserV2().value, DisplayName = OfficerNameCol1).Mail,
     Department: "", 
     JobTitle: "", 
     Picture: ""
    }
}

Note: Firstly, you need to add Office 365 Users connection as data source in your app before trying above formula.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

10 REPLIES 10
KrishnaV
Community Champion
Community Champion

Hi @DBJ ,

 

i:0#.f|membership| This works with only the existing domain users see the below sample code for your reference:

Patch(
    'Project Details',
    Defaults('Project Details'),
    {Title: TextInput6.Text},
    If(
        !IsBlank(TextInput7.Text),
        {
            Collaborator: {
                '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Claims: "i:0#.f|membership|" & Lower(TextInput7.Text),
                Department: "",
                DisplayName: "",
                Email: Lower(TextInput7.Text),
                JobTitle: ".",
                Picture: "."
            }
        }
    )
);


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 



I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a THUMS-UP and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Hi @KrishnaV 

 

This is for the existing domain user, that is why it's strange that it is not working. Like I mentioned before the value gets patched correctly to the list but an error still gets thrown.

KrishnaV
Community Champion
Community Champion

Hi @DBJ ,

 

That is strange one last possibility is a user might be expired (I am account deactivated).


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

 



I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
KrishnaV
Business Applications MVP, Microsoft Certified Trainer
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a THUMS-UP and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

v-xida-msft
Community Support
Community Support

Hi @DBJ ,

Could you please share a bit more about the "OfficerNameCol1" variable? Does it store the display name of the user?

 

Based on the formula that you mentioned, I think there is something wrong with it. The value provided for the Claims attribute should contains the email address of the user rather than Display Name. The standard value format for the Claims attribute should be as below:

"i:0#.f|membership|user1@email.com" 

 

On your side, please consider modify your formula as below:

{
  'Officer Name': {
     Claims: "i:0#.f|membership|" & Lower(LookUp(Office365Users.SearchUserV2().value, DisplayName = OfficerNameCol1).Mail),
     DisplayName: OfficerNameCol1,
     Email: LookUp(Office365Users.SearchUserV2().value, DisplayName = OfficerNameCol1).Mail,
     Department: "", 
     JobTitle: "", 
     Picture: ""
    }
}

Note: Firstly, you need to add Office 365 Users connection as data source in your app before trying above formula.

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi ,

 

I am getting the same issue but I am using Combo box and User should select multiple user. When I select on Edit I am getting error when I select user again then it will not give me error.

ForAll(
cb_MP_Owner_2.SelectedItems,
Collect(
colPeople,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & ThisRecord.Mail,
Department: "",
DisplayName: ThisRecord.DisplayName,
Email: ThisRecord.Mail,
JobTitle: "",
Picture: ""
}
)
);

I am Storing the value in Collection : colPeople and then patching the collection in owner column. The above code works fine while adding.Could you please let me know what is the issue here.

ezi79
Helper III
Helper III

I got the similar issue . I am editing record from gallery item selected.  People picker is a combo box when i try to edit my record i have to re-select the user  form the combo box in order to update the record. When i play the app i get the 'Specified user i:0#.f|membership| could not be found" while trying to patch to SP list but value still gets patched error.
SubmittedOrPM: {
'@odata.type': "#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & combopm_1.Selected.Mail,
Department: "",
DisplayName: "",//combopm_1.Selected.DisplayName,
Email: "",//combopm_1.Selected.Mail,
JobTitle: "",
Picture: ""

Could you please help?

Anonymous
Not applicable

I ran into this |membership| error while setting the DefaultSelectedItems property to the current user, using a variable and the Office 365 Users connector. A formula I had used many times before just stopped working and threw this error. I resolved it by pasting this into the DefaultSelectedItems:

 

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

 

I'm defaulting the field to the current user, but they could remove their own name and enter someone else's. So elsewhere in the app, I am still using the Office 365 Users connector to look at the DataCardValue.Selected person and get their manager and job title. But for the initial default user -- I found that only this code (above) worked.

Thanks to: https://mohitvash.wordpress.com/2021/06/17/power-apps-set-default-value-to-sp-user-or-group-field/

Hi RachelRig, I also had to use this code to sort out a problem I was having where I had a people column in a canvas app. In the app users create new cases, and they would start typing and a name would appear, but when they tried to save the new case they were getting an error. I am not sure if you can help me with my question (and hopefully it isn't a silly question), but my understanding is this is due to these employees being de-activited as they were on long term leave, so by using this code am I re-adding them to Active Directory? Because I know from our IT's perspective they will not be happy to find that licences are being used up for people they have deactivated. Again, I am not sure if this is something you can help me with, but I thought I would ask.

Anonymous
Not applicable

@hsfournier No, I don't believe we can actually add/remove/activate users in Active Directory with functions used here in this way. I know for certain that I got this error on active users who had definitely not left the company or anything like that. This error was a complete mystery to me. As I said, code I had been using for months just suddenly didn't work anymore. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,065)