Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get EMail from UserField which has multiple selections #778

Closed
3 tasks
enti333 opened this issue Jul 11, 2019 · 8 comments
Closed
3 tasks

Get EMail from UserField which has multiple selections #778

enti333 opened this issue Jul 11, 2019 · 8 comments

Comments

@enti333
Copy link

enti333 commented Jul 11, 2019

  • Enhancement
  • [ X] Bug
  • Question
  • Documentation gap/issue

Hello. When my user field has multiple selections enabled I am not able to get EMail data for these users. I ame able to get Title or ID but not EMail....

sp.web.lists.getByTitle(encodeURIComponent('XXXX')).items.filter("xxxxx eq '" + this.state.recipientDepartament + "'").select("kontakt_person/EMail").expand("kontakt_person").get().then(data => {

This throw an error when I disable multiple selections everything works.
Thank you very much for help.

@koltyakov
Copy link
Member

koltyakov commented Jul 11, 2019

What is the error message? SharePoint version?

Is unlikely an error in PnPjs but environment/artefacts/SP version.

And the scenario works for me in SPO, btw:

image

@enti333
Copy link
Author

enti333 commented Jul 11, 2019

Hello. The error is

Uncaught (in promise) Error: Error making HttpClient request in queryable [500] ::> {"odata.error":{"code":"-2146232832, Microsoft.SharePoint.SPException","message":{"lang":"en-US","value":"Cannot get value for projected field kontakt_person_x005f_EMail."}}}

Thank you... I have tested it again when this field is not Multiple it works if it is multiple it doesn't but only for EMail property...Title and ID is OK...Thank you

@enti333
Copy link
Author

enti333 commented Jul 11, 2019

I think that I found the problem is I have in this field user which doesn't have email account

This user doesn't have an Exchange Online license.

and it doesn't work....But question is ...is this OK that it ends with error? Thank you

@koltyakov
Copy link
Member

These cases with HTTP 500/other StatusCodes is a server API response, 100% non-library.

@enti333
Copy link
Author

enti333 commented Jul 11, 2019

Hmm....But my test user doesn't have email account...When field is not set for multiple it works and in EMail property I have null....But When I enable Multiple it ends with this error.... So Again it is OK that it doesn't have null but ends with error...Thank you

@koltyakov
Copy link
Member

It's not ok, IMO, but it is current SharePoint API behavior, and I think I faced the same too yet it was not critical in my case. Unfortunetely nothing can be changed in the library to fix server side of the REST API as PnPjs is a client.

@enti333
Copy link
Author

enti333 commented Jul 11, 2019

Thank Andrew for you help:)

@github-actions
Copy link

This issue is locked for inactivity or age. If you have a related issue please open a new issue and reference this one. Closed issues are not tracked.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants