0

Take this odata query for example:

_api/web/lists/getbytitle('Site')/items?$top=10&$orderby=Id asc&$select=Id,Title,URL,AuthorId,Author/FirstName,Author/Lastname&$expand=Author

What gives away that you can expand the "Author" with FirstName and LastName aside from just knowing you can do that? How do I know what other fields I can expand if I wanted to? And if I could expand another field, what can I expand them to?

No amount of querying has given me any insight into know what's expandable and what is not, as well as knowing "What" sub-items you can expand them with (how would I know you could grab FirstName, but not First?). Is this just something baked into the API or is there some sort of way to determine where this info exists? For instance, how would I know I couldn't look up Author/SSN without querying for it only to find out that it in fact, does not exist?

  • How did you know there was a URL field on the "Site" list? Did you query for it? From my reading it seems that expand works for Lookup fields, so the same way you know what fields to put in the select part _by inspecting the columns on the "Site" list for example_ you can go to the other list and inspect its columns I assume – 3m3sd1 Aug 25 '22 at 06:37
  • I knew because you can see the columns in SharePoint or in the list settings. I was asking for the indicator that states "This Field is a Lookup field" and that I can look for more data wihtin it. – employeeWithCode Aug 25 '22 at 13:00

0 Answers0