0

I was trying to retrieve user WorkPhone from a people and group field but its throwing error saying

The query to field 'Application/WorkPhone' is not valid.

But I tried the same query for the MobilePhone and Email that's working fine. Please guide me where I am going wrong.

  • Have you tried just "Phone"? – wjervis Mar 14 '18 at 17:02
  • Hi that is also not working I don't understand same API is able to give me result for the MobilePhone and it's not working for WorkPhone – Amish raj Mar 15 '18 at 4:09
  • how about something like https://sitecollecurl/_api/lists/getbytitle('List name')/items?$expand=Application&$select=Application/WorkPhone,Application/EMail,Application/Title ? – Gautam Sheth Mar 15 '18 at 4:48
  • sorry this also dint worked getting below error The query to field 'Application/WorkPhone' is not valid. – Amish raj Mar 15 '18 at 6:08
  • Does the value of the item contain a group? I found that I get no error if it's a person in the field, but if I put a group there, I get a 500. But I got a different error message. – wjervis Mar 15 '18 at 12:16
0

2010 or 2013 REST? On-prem or Office 365/SharePoint Online?

What was your REST URL?

Please update your question...

This works for me in SharePoint Online:

https://yourServer/sites/site/_api/SP.UserProfiles.PeopleManager/GetUserProfilePropertyFor(accountName=@v,propertyName='WorkPhone')?@v='i:0%23.f|membership|samc@yourDomain.com'
  • Thanks for your answer I am trying to fetch via mentioned url url/_api/lists/getbytitle('List name')/items?$expand=name_x0020_Manager/ID&$select=name_x0020_Manager/WorkPhone Instead of WorkPhone if i use Mobile Phone it works fine and give me result for the phone number – Amish raj Mar 15 '18 at 3:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.