question

gh-2449 avatar image
1 Vote"
gh-2449 asked Jerryzy answered

SharePoint Person field in Rest API

I have one sharepoint list which is using Person Field, which data source is a user in SharePoint

If I use OData url with "FieldValuesAsText" I can see data like username. However without FieldValuesAsText I can only get a int value seems it's the user id.

Since, my list is very big and want to retrieve data in minimum number of calls. looking for some kind of approach or URL which will help me achieve the same in Rest API

office-sharepoint-server-development
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

Jerryzy avatar image
3 Votes"
Jerryzy answered

Hi @gh-2449,

Try to expand Person field to get username like this:

.../_api/web/lists/getbytitle('ListName')/items?$select=MyUserField/Name&$expand=MyUserField


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.