0

I use REST/JSON to query Sharepoint 2013 where "expand" helps me to retrieve the authors name from a foreign list.

.../_api/lists/getbytitle('list1')/items?$select=*,Author/Title&$expand=Author

Because selecting Author/* does not work I'm having a hard time finding out the fieldnames of that list.

.../_api/lists/getbytitle('list1')/items?$select=*,Author/*&$expand=Author

Due to my lack of understanding where those foreign lists reside I haven't been able to find them in my sharepoint-installation. Asking Google and MSDN could not help me either. I found some basic concepts - but none of them provided that information.

So where can I find those foreign lists and query them?

Where can I find a list of those lists - "Author" doesn't seem to be the only one...

1 Answer 1

1

If I understand you correctly you need ListName or ListGuid of Lookup field ?

You can get it from /_api/lists/getbytitle('list1')/Fields - here you find Author Lookup field and Guid of list you are looking for.

Inside of Field XML you get this, like in my example:

<d:LookupList>{5cc890cb-1974-4142-9939-c41c2539e03e}</d:LookupList>

To get all items inside of Lookup list: _api/web/Lists(guid'5cc890cb-1974-4142-9939-c41c2539e03e')/items

Use PostMan or some similar plugins to display this XML more friendly.

It would be better to describe the main goal. Hope this helps.

1
  • I've created a newsslider for our SP-startpage. My new task is to add user information to each of those newssheets (name, department, picture). The goal is to achieve this without initating separate queries for each sheet. "expand=Author" seemed to do the trick, but I could not find out the right fieldnames - at least until your reply. But since userpic-URL's aren't accessible I don't think there is a way around those extra requests...
    – tiMbeRdroP
    Apr 28, 2014 at 13:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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