Domanda

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 
È stato utile?

Soluzione

Use this:

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

Test result: enter image description here

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top