Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8431067
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:45:25+00:00 2026-06-10T05:45:25+00:00

Trying to programmatically get a list name from a url, then looking to pass

  • 0

Trying to programmatically get a list name from a url, then looking to pass the list name to the web service Lists (_vti_bin/Lists.asmx) in order to use the GetListItems or even use the Webs service to use GetViewCollection passing in the list name. Issue is I am able to get the list name as it shows in the title, but when passing it to either GetListItems or GetViewCollection it complains about incorrect GUID.

Example:

Sample url:

http://test.com/List Name Here/

I’m able to parse out “List Name Here” by using the Views service but when passing in “List Name Here” to GetListItems it fails with message regarding incorrect GUID. I guess I’m looking to see if this is possible and if so what format does the list name need to be internally to be able to pass to the GetListItems method?

EDIT

Just discovered one of the issues is SharePoint does some parsing of the list name int the url, removes commas, brackets, periods and dashes so the list name in my case had a period in the name which was striped out. So I might have to tell the end users to follow a naming convention unless there is any other way to get the full unedited list name.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:45:27+00:00Added an answer on June 10, 2026 at 5:45 am

    Was able to get the actual list name by looping through the list collection (GetListCollection().ChildNodes). This allowed me to use the “DefaultViewUrl” and “Name” attributes to pass the correct list name to the GetListItems web service method. This allows the end user to pass in a url from SharePoint and the processing will determine the list name so it doesn’t have to be provided in a config files etc.

    Code below shows the basics to determine the list name from a url;

    string name = string.Empty;
    foreach (XmlNode ls in list.GetListCollection().ChildNodes)
    {
        //Check whether list is document library
        if (Convert.ToInt32(ls.Attributes["ServerTemplate"].Value) != 0x65)
        {
            continue;
        }
    
        string defaultViewUrl = Convert.ToString(ls.Attributes["DefaultViewUrl"].Value);
    
        if (defaultViewUrl.Contains(listName))
        {
            name = ls.Attributes["Name"].Value;
            break;
        }
    }
    
    XmlNode ndListItems = list.GetListItems(name, null, ndQuery, ndViewFields, null, ndQueryOptions, null);
    XmlNodeList oNodes = ndListItems.ChildNodes;
    
    // rest of processing below...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to programmatically get a list of ElastiCache endpoints from my Java app
I'm trying to create a menu for my web site programmatically from an xml
I am trying to install apk programmatically from SD card without mentioning the name
I'm trying to programatically get a list of installed fonts in C or Python.
I am trying to get to grips with programmatically configuring views. I have a
I am trying to work with a UIImageView programmatically and can't get it to
I'm trying to programmatically add an Execute SQL task from within a script task
I am trying to programmatically create a PowerPoint from graphs in Access. Ideally, when
i am trying to programmatically attach an image to an email body from my
I'm trying to get a list of all users and all groups on Mac

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.