Frage

I'm using the following URL to get data from a list. The last item in the URL is the Author/Id but it returns a number.

How can I get the user's name instead of the number?

url: https://.../org/eu/EU3/EU34/_api/web/lists/GetByTitle('EU34SupportTracker')/items?$select=Title,Attachments,AttachmentFiles,Worklog&$expand=AttachmentFiles&$expand=Author&$select=Author/Id 
War es hilfreich?

Lösung

Use this:

$select=Author/Name,Author/Title&$expand=Author

Test result: enter image description here

Andere Tipps

This behavior is correct. In order to get the name of user you need to use below REST API URL:

https://.../org/eu/EU3/EU34/_api/web/lists/GetByTitle('EU34SupportTracker')/items?$select=Title,AttachmentFiles,Worklog,Author/FirstName,Author/LastName&$expand=AttachmentFiles,Author

Or If you have set the display name to user fields then you can also use:

Author/Title

instead of Author/FirstName and Author/LastName

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange
scroll top