Modify list view - Group by Lookup column's ID

Hi
I have a main list that has a lookup column. The grouping works fine, but I want the sort order of the group to appear as the way the lookup value's ID is ...
What are the ways to achieve this, I do not want to put a number in front of the values, is there another way to do this

I understand that you don't want to add additional info in front of the lookup column values to keep the value exactly as expected.
as SharePoint 2010 allows to lookup additional fields, I would suggest to lookup the item ID also with the lookup column.
1. create a lookup column lookup your expected list.
2. in the lookup column settings, "Add a column to show each of these additional fields", check "ID" column.
3. group by the list view with the additional ID instead.
There is an issue by doing this step, the groupby title value is the lookup ID column not the original lookup column, as we actually doesn't use the lookup columnn with grouping.
For this, you can use SharePoint Designer to edit the list view, change the groupby row cell to the lookup column value instead.
Qiao Wei <br/> My blog:http://blog.goobol.com

Similar Messages

  • Updating a title column in list that is a lookup column to document library in sharepoint designer workflow 2010

    Hi I have a requirement to create a list item in Contracts List when a document is uploaded in Contracts Vendor library.
    Contracts List will
    have  columns - Contract Name ( title column), Contract Number, Contract Start date and end date.
    Contracts Vendor library will have Contract
    Name,Contract NUmber.
    User will select the Contract Name from drop down ( this is look up column linked to Contract Name in Contract
    List).When user uploads document in Contract Vendor library then item should be created in Contract List with selected Contract Name and
    Contract number .
    Contracts and Contracts Vendor are related by look up Contract Name. Contract Name is internally a title column in
    Contracts List.
    Issue1 :
    Since Contract number is look up column, while I am creating item the Contract name is not getting updated in
    Contracts List. I have to use sharepoint designer workflow to achieve this task. Title colum or Contract Name shows no title.
    Issue 2:
    One
    more issue I am facing is that Contracts List has Section and Division cascaded drop downs when i select values from section and division
    dropdowns and save item in Contracts list the values are getting saved in Contract List.
    Could anyone suggest me how to handle this ? I am
    attaching the screenshots of the list and library structure. TRuly appreciate your help.
    Below are screenshots of the list structure

    Hi,
    According to your post, my understanding is that you wanted to update a title column in list that is a lookup column to document library in sharepoint designer workflow 2010.
    I try to reproduce the issues as follows:
    Create a custom list named Contracts List, add columns: Contract Name ( title column), Contract Number(Number), Contract Start date(Data and Time) and Contract End date (Data and Time).
    Create a document library named Contracts Vendor library, add columns: Contract Name(Lookup), Contract NUmber(Lookup).
    Create a workflow associated to the Contracts Vendor library.
    Add action: Create List Item.
       5. Start the workflow automatically when an item is created.
       6. Upload a document, select the Contract Name and Contract NUmber, the workflow will be started automatically.
       7. Open the Contracts List, an item will be added with the Contract Name and Contract Number in the Contracts Vendor library.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to create a view based on Lookup Column?

    Hi All,
    I am working as a SharePoint developer 2013.
    When i tried to create a view based on look up column it is not showing lookup column.
    How to fix this problem?
    Please help me out here.
    Thanks & Regards,
    Santhoshi

    can you elaborate the issue? Do you mean you cannot view the column name in the filter section when creating a new view for the list or the column is not getting displayed in the view created?
    --Cheers

  • List view displayed in 2 columns

    I want to display a list view that is grouped by a field in 2 columns. Not sure how to accomplish this
    Cat1                       Cat 2
    1,2,3,4                    1,2,3
    Cat3                       Cat 4
    1                            1,2

    I can programmatically create the view.  I am not sure how to get it into 2 columns.  here is my code.
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Collections.Specialized;
    namespace SharePointProject3.WebPart1
        [ToolboxItemAttribute(false)]
        public class WebPart1 : WebPart
            protected override void CreateChildControls()
                using (SPSite site = new SPSite("http://site"))
                    using (SPWeb web = site.OpenWeb())
                        web.AllowUnsafeUpdates = true;
                        //Get the List
                        SPList ProjectDocuments = web.Lists["Vendor"];
                        //Set the View fields
                        StringCollection ViewFields = new StringCollection();
                        ViewFields.Add("Type");
                        //Set the View Filter and Sort order
                        string viewQuery = @" <GroupBy Collapse=""TRUE"" GroupLimit=""100""> <FieldRef Name=""SubCategory""/>
    </GroupBy><Where><And><Eq><FieldRef Name=""VendCat""/><Value Type=""Text"">eCommerce and Marketing</Value></Eq><Eq><FieldRef Name=""Active""
    /><Value Type=""Boolean"">1</Value></Eq></And></Where>";
                        //Create the view
                        ProjectDocuments.Views.Add("Proposal Documents", ViewFields, viewQuery, 100, true, false);
                        //Update the List
                        ProjectDocuments.Update();
                        web.AllowUnsafeUpdates = false;
                        web.Dispose();
                    site.Dispose();

  • Move sharepoint 2010 list to 2013 with lookup columns

    Hi all,
    Iam planning to move my sharepoint 2010 list to 2013.I done this using save site as template.But the look up columns are showing empty data.Can u please let me know the best solution to do this.
    Regards,
    Praveen

    The reason the lookup column doesn’t work anymore in your SharePoint 2013 list is because Save
    Site as Template, preserve all the list settings. Therefore, the lookup column still points to the original list which
    was located on your SharePoint 2010 list. The lookup column stores GUID of the web, list, and the field to which it points
    and GUID are unique IDs that identifies a list/library/site/feature in a farm.
    Using SharePoint Manager you can find the LookupList, LookupWebId and LookupField of
    your old SharePoint 2010 lookup column and compare it with your new 2013 lookup column. You will see the difference.
    There are two approach to get your values in lookup again.
    1(a). Create a new list and update the lookup values.
    1(b). Delete the lookup column and create a new lookup column and point it to the new list created in the above point.
    2. Update the SchemaXml property
    of the lookup column through SharePoint Manager.
    I will provide you with a good reference on how to use SharePoint Manager while managing your lookup columns. http://blog.johnsworkshop.net/moving-lists-with-lookup-columns-inside-your-site-collection/
    Please remember to click 'Mark as Answer' and Vote as Helpful if the reply answers your query.

  • Document library view: Group by a column with multiple values

    I have a document library which has a managed metadata column.
    I would like to create a view which groups the documents by this managed metadata column.
    The managed metadata column can have multiple values.
    I know that this is not possible with SharePoint's group by, since it only accepts those columns which can have only one single value.
    But is this possible to accomplish by some other means, e.g. Content query web part? Or is there perhaps a 3rd party solution to this?
    Is it possible to change the group by settings somehow to allow Group by to function with columns with multiple values? <- this may be far fetched...

    Hi Pekch,
    I'm assuming you have VS2010 to build the custom web part. From there you will need to figure out the following:
    Get a SPList object for the Document Library (See below for code example)
    Loop through all the documents in the SPList object 
    If you have audience targetting enabled, then you'll need to determine if the user has access to the document by checking the "Target_x0020_Audiences" column)
    As you also want to group by metadata, you'll need to populate 2 datatables (one table with a column containing unique metadata values and another table with a metadata column and other document related columns).  Link these two tables via a dataset
    relation.
    Set the dataset as the datasource for a repeater, add in some css and javascript for the group expand/collaspe and it should be close to what you need.
    This will be a time consuming task if you don't know where to start or have problems figuring out how to perform a certain operation.  So you may want to determine if the functionality you want is required or just a "nice to have".  Good
    luck and if I have some spare time, I'll create a blog post outlining how to do all the above.
    I got the below code from a sharepoint blog sometime in the past and you can use it to retrieve a list.
    You can use it like this: GetListByUrl(http://servername/Shared%20Documents/Forms/AllItems.aspx)
    using    Microsoft.SharePoint;
    public SPList GetListByUrl(string listURL)
    SPList list = null;
    try
    using (SPSite site = new SPSite(listURL))
    if (site != null)
    // Strip off the site url, leaving the rest
    // We'll use this to open the web
    string webUrl = listURL.Substring(site.Url.Length);
    // Strip off anything after /forms/
    int formsPos = webUrl.IndexOf("/forms/", 0, StringComparison.InvariantCultureIgnoreCase);
    if (formsPos >= 0)
    webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/', formsPos));
    // Strip off anything after /lists/
    int listPos = webUrl.IndexOf("/lists/", 0, StringComparison.InvariantCultureIgnoreCase);
    if (listPos >= 0)
    // Must be a custom list
    // Strip off anything after /lists/
    webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/', listPos));
    else
    // No lists, must be a document library.
    // Strip off the document library name
    webUrl = webUrl.Substring(0, webUrl.LastIndexOf('/'));
    // Get the web site
    using (SPWeb web = site.OpenWeb(webUrl))
    if (web != null)
    // Initialize the web (avoids COM exceptions)
    string title = web.Title;
    // Strip off the relative list Url
    // Form the full path to the list
    //string relativelistURL = listURL.Substring(web.Url.Length);
    //string url = SPUrlUtility.CombineUrl(web.Url, relativelistURL);
    // Get the list
    list = web.GetList(listURL);
    catch { }
    return list;

  • List view to include a column or field which would display the sequence number in a view

    I have a view for a list which displays items following any condition or sorting. Now, i would like to display the list items in such  a way that
    the auto incremented numbers are displayed as an arbitary field which would display the numbers such that
    its just going to display items in sequence. Is there anything that can be done in sharepoint designer for the list to accomodate a column/field which would display the sequence numbers.
    Thanks

    There are columns such as
    Name, Goals
    and  it should be arranged in descending order of Goals and it could be paginated but also a column should be displayed for ranks e.g
    Name Goals Rank
    A          40     1
    B          39     2
    C          30     3
    So, the idea is the ways it is sorted in descending order, if we possibly have a counter then we could display the ranking of the items.
    Thanks

  • List Views displaying error - when using Lookup column for filtering ( which are indexed )

    I'm trying to filter a large list that has more items than the list view threshold. The list has a lookup column that is indexed. If I  try to filter by other columns, the view works fine as long as it returns fewer than 5,000 items. However, if
    I try to filter by the lookup column, I get the error about not being able to display the items because the list is too large.
    The views are returning items which are less than threshold value , but still I am seeing the same issue.I Created some pages and added this filtered views to the pages it is showing below error
    This view cannot be displayed because it exceeds the list view threshold ....
    IF I navigate the view in the list it's returning zero records with out any error page . But no records. 
    Is there a known issue with filtering large lists by lookup column? Any other troubleshooting suggestions? Everything I'm doing here is through the web interface.

    Thank you for your reply. Yeah it’s default limit. But when I created view based on some filter condition on lookup column it’s not working.
    For example:
    Created a View based on Lookup column DEPT using filter condition Dept = HR , returned 1400 items
    Created another View based on Lookup column DEPT using filter condition Dept=Admin , returned 3600 items
    Adding this list view webparts to the page also working fine , displaying the results .
    After adding one item to this list , both the views are not displaying any results. Now the count is 5001.(it exceeded the list view threshold)
    The page where the list view web parts are added throwing the below error.
    This view cannot be displayed because it exceeds the list view threshold (5000 items) enforced by the administrator.
    To view items, try selecting another view or creating a new view. If you do not have sufficient permissions to create views for this list, ask your administrator to modify
    the view so that it conforms to the list view threshold.
    Learn about
    creating views for large lists.
    I am experiencing this problem only with lookup columns, Choice and site columns are working fine in this same situation .
    Thanks,

  • Lookup Column Issue - List View Threshold exceeded

    We use Sharepoint Foundation 2010 and we have 2 Lists in a site. Those are:
    1. Customers List.
    2. Sale Invoices List.
    Customers List has Title field as Unique & Indexed Column.
    Sale Invoices List has a lookup column (i.e., Customer) from the Customers List (Title).
    My issue is:
    Customers List has just crossed 5000 items. When I try to add a List Item in Sale Invoices List (where I have Lookup Column from Customers List), it throws an error as given below:
    Error Message:- This is a lookup column that displays data from another list that currently exceeds the List View Threshold defined by the
    administrator (5000). To add items to the current list, please ask the list owner to remove this column.
    I have increased temporarily the List View Threshold Limit to 6000 Items. It’s working fine now.
    Is there any solution to fix the issue without increasing the List Items Threshold Limit?
    Thanks in Advance.

    Hi Sri,
    If this activity (adding item) is done programmatically, then we can set
    SPList.EnableThrottling = false
    but this approach is not recommended though.
    Please let us know if this fixes your issue.
    Thanks,
    M.Gubendra Raj

  • Custom column added is not available for Calendar list view in SharePoint 2010

    I created a custome column "Breakline" in a custom content type 'SM event", and applied the content type to a Calendar.
    The column is listed under the content type "SM event" but it is not listed when I tried to modify the view using the "Breakline" column.
    Does anyone know why?

    I set "Breakline" hidden because I don't want to show this in create new item form. 
    I realized that may be the reason. So changed the column to Optional in CT and created a new calendar using that CT. then at list level CT I changed it to Hidden.  That works.   The column is available for use when modifying view.
    Thanks

  • Lookup Column Threshold in List in O365 (Sharepoint 2013)

    Hi All - We have a very important list and are hitting the Lookup column threshold of 8.  My understanding is that when looking at the whole list in a view that shows all the columns, the 9th lookup operation will fail.  
    But what happens if there is a view that contains lookup columns 2-9, and not #1.  Will #9 show up?
    Also, I see the following in the documentation "This does not apply to single item operations"  Does this mean that I can
    have 20 lookup items which will show when I am looking at an individual item in View or Edit mode?
    Thanks!

    I believe O365 now has a 10 column lookup threshold, increased from the default 8.
    I think regardless of the view, you'll see the issue, except in the case where you're only viewing a single item, as you've noted.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Calculated column doesn't expand the items in list view

    Dear All,
              I have a calculated column
    Week with formula, =INT((DAY([Start Time])+6)/7) 
    in one of my lists. I'm displaying a view of this list in a SharePoint page, group by column Year and column
    Week. But when the page is loaded with items, I'm only able to expand the list view up to
    Year column level. When I click on Week section it doesn't show / expand the items under it.
    Further more when I use a different calculated column with a function like (=TEXT(Date,"yyyy")) I don't get above error.
    Any Idea?
    Thanks,
    Dilip

    Hi Dilip,
    According to your description, an issue occurs when you try to expand the subgroups in a list contains Calculated column.
    It is an known issue in SharePoint 2013, there are some workarounds I can provide as below:
    As the first workaround, you can set the groupings to expanded by default, though it would make the grouping collapsed by default, then the grouping would function
    normal.
    As the second workaround, you can create a SharePoint Designer Workflow and add a “Do Calculation” action to calculate the value you needed. Then add a “Update List
    Item” action to add the value to a “Single line of text” column. We will use the “Single line of text” column in the grouping instead of the Calculated column.
    As the third workaround, you can install the latest update of SharePoint to fix the issue for new Document Libraries. For the existing libraries, after the installing
    the update, you can use PowerShell to make an update to each item in the library, it will make the old items get normal in the grouping.
    About how to update list items in a list/library using PowerShell, a demo as below for your reference:
    $web = Get-SPWeb http://YourServer/
    $list = $web.Lists["list name"]
    foreach ($item in $list.Items)
    $item.SystemUpdate();
    Best regards
    Patrick Liang
    TechNet Community Support

  • How do I remove the grouping headings in my list view web part?

    I don't have access to SharePoint Designer and so far, that is all I can find that people are saying to use.  I understand and know how to edit the HTML in SharePoint, just don't know what code to put in and where exactly to put it so that the Document
    Library List View web part is grouped how I want, but doesn't actually show the group titles.  Any help would be greatly appreciated.  Thank you!

    Hi,
    I understand that you want to hide list view group headers, based on your description, I can suggest as follow:
    Add this code to a Content Editor Web Part (CEWP) in the list view. Adding a CEWP in a SharePoint 2010 list view will unfortunately remove the list view selector.
    <script type="text/javascript" language="javascript">
    _spBodyOnLoadFunctionNames.push("HideHeaders");
    function HideHeaders()
    var elements = getElementsByClassName(document, "td", "ms-gb");
    var elem;
    for(var i=0;i<elements.length;i++)
    elem = elements[i];
    elem.childNodes[3].style.display = "none";
    elem.removeChild(elem.childNodes[4]);
    elements = getElementsByClassName(document, "td", "ms-gb2");
    for(var i=0;i<elements.length;i++)
    elem = elements[i];
    elem.childNodes[3].style.display = "none";
    elem.removeChild(elem.childNodes[4]);
    elements = getElementsByClassName(document, "tr", "ms-viewheadertr");
    for(var i=0;i<elements.length;i++)
    elem = elements[i];
    elem.style.display = "none";
    Written by Jonathan Snook, http://www.snook.ca/jonathan
    Add-ons by Robert Nyman, http://www.robertnyman.com
    function getElementsByClassName(oElm, strTagName, strClassName){
    var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
    var arrReturnElements = new Array();
    strClassName = strClassName.replace(/\-/g, "\\-");
    var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
    var oElement;
    for(var i=0; i<arrElements.length; i++){
    oElement = arrElements[i];
    if(oRegExp.test(oElement.className)){
    arrReturnElements.push(oElement);
    return (arrReturnElements)
    </script>
    More information:
    http://edinkapic.blogspot.in/2008/06/hiding-list-view-group-headers.html
    http://spjsblog.com/2011/08/30/remove-group-label-in-grouped-list-view/
    If you have any questions, please reply me.
    Thanks,
    Qiao Wei
    TechNet Community Support

  • How to Hide Size Column in List View

    My default setting for the Finder is to have folders display in list view with the size column turned off. This works like a charm for every folder except the Applications folder which always displays a size column whenever the finder is re-launched (it's always scrolled to the bottom of the list too, which is weird). It wouldn't bother me if the size values were cached somehow and just updated quietly in the background but it takes quite a while to calculate each value and actually slows down the finder.
    I've tried deleting finder preferences but to no avail.
    Does anyone know what's going on here?
    [The above was originally posted here [http://discussions.apple.com/thread.jspa?messageID=9524102#9524102] but I was asked to move along by a surly faced police officer]

    OK. Problem fixed but unfortunately not completely solved.
    Talking about permissions and administrator issues made me wonder, so I logged in using my admin account and seemed to be having exactly the same issue. I was unable to set a default permamantly for the Applications folder. Except that when I tried to set a default in another folder (Documents I think) and restarted the Finder the setting held for all directories. When I logged back in under my regular user account it also held.
    I have finally eliminated that pesky size column -- for good! (Of course I may want it occasionally, but that's at my discretion). The window also maintains a correct scroll point, corresponding to where it was last positioned.
    I wish I knew exactly what has happened. All I really know is that fiddling (as usual) has fixed it and that it probably has something to do with Administrator privileges.
    Thanks again for your suggestions and especially for being a sounding board.
    Josh

  • How to query the sharepoint list with using lookup column

    hi,
    I have requrement like below
     List A
    Title                         Postionid(Lookup)       PositionDescription
    [email protected]             1                              
    xxxx
    [email protected]             1                               
    xxx
    [email protected]           1                                
    xxx
    [email protected]                    2                               
    sss
    [email protected]             2                               
    www
    List B
    Title                         fistname  lastname age fathername
    [email protected]         x             x             10      y
    [email protected]         p            p               12      p
    [email protected]               q           q                12    
    y
     here in List A positionid is lookup column i have creating one visual web part i am querying the List A using  query string as Positionid in that web part .finally what i want is i need date from list B on basis of corresponding position id here
    List A Title and List B title are same i need each candidate info how can i do it
    Srinivas

    Hello,
    Still you have not told that whether Position id is there in listB or not. Anyway if Poistion id is not there in list B then you have to use Title column of listA to gete data from ListB. Look at sample code below. It will first get data from ListA,
    and use StringBuilder class to create dynamic CAML query because one Position id is having multiple values in listA.
    query.Query = "<Where><Eq><FieldRef Name='Postionid' /><Value Type='Lookup'>1</Value></Eq></Where>";
    SPListItemCollection items = list.GetItems(query);
    if(items.Count > 0)
    foreach(SPListItem item in items)
    string strTitle = Convert.Tostring(item["Title"]);
    //since listA is having multiple values for Postionid so you have to build a dynamic query here to get data from listB
    //Refer link to build dynamic query
    SPQuery listB = new SPQuery ();
    query.Query = stringbuilder;
    SPListItemCollection ListBitems = listB.GetItems(query);
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/2dfe5fd6-e556-4132-a35c-e9f240360307/issue-with-caml-query?forum=sharepointdevelopmentlegacy
    http://sharepoint.stackexchange.com/questions/69690/foreach-loop-inside-caml-query
    Above links will help you to create dynamic query (in your case you need to use multiple <OR> operator in listB.
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • [Resolved] No boot with K8N sli Platinum & AMD 64 X2 3800+

    Hye, I've received these new stuff last night (everything is good until here) : - Antec Sonata II 450W - MB MSI K8N SLI Platinum - Proc. AMD 64 X2 3800+ - GC Sapphire X800 XL 256Mo I've assembled all and turned it on... No bip... but all the fans are

  • Production order that generate purchase requisition

    Hi! I  need to now from where in SPRO I set the purchase requisition type that the system generate when I use MD02 transaction. The thing is that the system generates an NB type, and I would like to generate an PURE type. Can this be done?How? Also,

  • F4 Help in sm30

    Hello developers. I created a table contained 3 fields (MANDT, ID, NAME) then I made a projection view and the dialog for that. When I try to insert the value and press F4 all I can see is only the one field: ID. I would like to see NAME too. Popup i

  • Migratiing CR XI to 64 bit Windows and RDC ASP

    Which is the best time/cost strategy for the following problem: We have developed a WEB application that is running on a WINDOWS Server 2003 (32bit). The aplication was programmed to use de COM+ environment with asp for the Activex viewer. We are mig

  • Need date difference in Minutes

    Hi, I want to get the difference of date in minute. Please help me out. format is mentioned below in the query select (to_date('9/19/2007 8:02:33 PM', 'MM/DD/RRRR HH12:MI:SS AM')      - to_date('9/19/2007 7:02:02 PM', 'MM/DD/RRRR HH12:MI:SS AM')) fro