Provide List Name in GetListItems

Jun 25, 2011 at 11:28 AM

I have a page that displays all of the Lists in a Site using GetListCollection, and this is working. I want to display a list of Items in each List underneath the List using GetListItems. Example:

---- List 1

-------- Item 1

-------- Item 2

---- List 2

and so on..

In the GetListItems call, I need to insert the currently retrieved list programatically. Which field do I need to use (Title, ID, GUID, etc) and how do I retrieve that in code? I assume that this will be of the form

$().SPServices({
      operation: "GetListItems",
      listName: $(this).attrib(????),

but I am not sure which attribute to use, or if a different function is required.

Thanks for your help!

Coordinator
Jun 25, 2011 at 2:14 PM
Edited Jun 25, 2011 at 2:26 PM

Assuming the list is in the current site:


listName: $(this).attr("Title"),
M.
Jun 25, 2011 at 4:35 PM

Thanks, Marc. It seems as though either Title or ID will work, which is handy.

Cheers

Steve

From: sympmarc [email removed]
Sent: Saturday, June 25, 2011 3:14 PM
To: steve.eagleson@sky.com
Subject: Re: Provide List Name in GetListItems [SPServices:262771]

From: sympmarc

Assuming the list is in the current site:

listName: $(this).attr("Title"),

M.

Coordinator
Jun 25, 2011 at 6:48 PM

That's correct, as the docs in the SDK state:

listName - A string that contains either the display name or the GUID for the list. It is recommended that you use the GUID, which must be surrounded by curly braces ({}). When querying the UserInfo table, the string contains "UserInfo".

You needc to use the MSDN-based SDK in tandem with the SPServices docs.

M.

Jun 25, 2011 at 10:56 PM

> You needc to use the MSDN-based SDK in tandem with the SPServices docs.

So I am discovering  ;-)

Thanks again for your help!