Getting the distinct person or group column from a splist

Hi,
I am trying to get a distinct user type column from my splist. customerUserID is my column name which of type "Person or Group".
I am having multiple entries in my splist. i want to pas  my curentoggedinuser and compare it against the values from the "customerUserID".
 i tried  using the linq ,but it fails.
can someone pls help whats the code i need to try.
DataTable dt = items.GetDataTable();
DataView dtview = new DataView(dt);
DataTable dtdistinct = dtview.ToTable(true, "customerUserID");
bool exists = dtdistinct.Select().ToList().Exists(row => row["customerUserID"].ToString().ToUpper().Equals(SPContext.Current.Web.CurrentUser.LoginName.ToString()));
if (exists == true ) break;
am trying teh above code,but i am unable to get the distinct value[ i need only one record ].
but the above doesnt evaluate to true , eventhough ia m having the correct values in my splist.
Das

Hi,
Please refer to the following blog
https://rmanimaran.wordpress.com/2011/05/20/get-distinct-values-from-a-sharepoint-list-along-with-where-condition/
Please don't forget to mark it answered, if your problem resolved or helpful.

Similar Messages

  • My emails from the same person are grouped together, how do I undo this so that each email stands on it's own?

    1.My emails from the same person are grouped together, how do I undo this so that each email stands on it's own?
    2.Currently my emails are grouped together if the subject is the same, how do I undo this?
    3.My emails are "folded up", with tabs like "See more" - how do I undo this? - I want to see the full email at once without having to click multiple times in the email on "show more" etc.
    4.When I send an email to some one, a copy of that email is sometimes sent to me?? - this confuses my and make me think I by accident sent it to myself, but when I check it in the SENT box, it the correct recipient's name was used. How to fix this mystery?
    Please help, I am not good with computers so you will have to keep your answer simplictic or in steps.
    Thanks!

    Click the View menu in the Mail menu bar and uncheck Organize by Conversation.

  • Formula to populate one Person or Group column depending on the value of another Person Group column

    I am looking for a way to popluate the Account information of a Person based on another column where there name in another column.  I have Two Columns   "Name" which is a Person or Group information type and User Account which
    is also a Person or Group Information type.  When an Invidividuals name is entered into the Name column, I what the User Account column to prepolulate.

    Hi,
    For your issue, you can automatically populate User Information depending on the value of another Person or Group column by connectting with User Information List or  connectting with User Profile Web Service:
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=172
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to update person or group column with peopleeditor control values

    Hi,
    I have created custom aspx page and added "PeopleEditor" control(can select multiple users)  in that page. Now I am trying to update person or group column with peopleeditor control values.I am not getting any error if I select single user
    in PeopleEditor control but getting error if I select more than one user.
    UpdateItem(listItem, "ListColumnName",
    listItem.ParentList.ParentWeb.EnsureUser(peopleeditorId.CommaSeparatedAccounts));
    Can anybody help me out to resolve the issue?
    Thank you in advance!!!
    AA.

    First get all the users/groups from the PeapleEditor by using PeapleEditor.ResolvedEntities
    foreach (PickerEntity pickerEntity in peopleEditor.ResolvedEntities)
    SPPrincipalType principalType = (SPPrincipalType)Enum.Parse(typeof(SPPrincipalType), pickerEntity.EntityData["PrincipalType"].ToString());
    if (principalType == SPPrincipalType.User || principalType == SPPrincipalType.SecurityGroup)
    string loginName = pickerEntity.Key;
    //your code here
    else if (principalType == SPPrincipalType.SharePointGroup)
    string groupName = pickerEntity.Key;
    //your code here
    Add all the users/groups in an instance of SPFieldUserValueCollection
    and then update your list item.
    SPFieldUserValueCollection users = new SPFieldUserValueCollection();
    users.Add(new SPFieldUserValue(web,user.ID,user.Name));
    item["YourUserColumn"] = users;
    item.Update();

  • Unable to select SOME external users in person or group column in SharePoint O365

    Here's a head scratcher.
    We have an O365 SharePoint(G3) instance.
    Sent external users invites to join the site from the SharePoint Group that the external user will be placed.
    External users accepted invitations and now have access to the site with the correct permissions.
    Permissions assigned to SharePoint Group.
    Some external users can be selected for "Assigned to" field (person or group column type).
    Some external users canNOT be selected for "Assigned to" field (person or group column type).
    When typing external users name that canNOT be selected, the error message "No results found" appears.
    Went to Site Settings > Site Permisisons > Check Permissions and typed in external users name that canNOT be selected, the error message "No results found" appears.
    I have no idea why this would happen for some external users and not others.
    External users that can be selected and those that canNOT be selected are in the same SharePoint Group and have the same permissions.
    Could this be due to how the external user set up their account?
    Help me please. This is driving my crazy.
    Thanks in advance.
    Tamara
    The Stumped SharePointer
    Tamara Bredemus SharePoint Minion...working up to Maven

    Hi Miikka,
    can you try cleaning up the user information list via powershell and reconfigure the userprofile sync.  following url contains the powershell script for user information clean up
    http://blog.fpweb.net/how-to-clean-up-sharepoint-user-information-list-with-powershell/#.VPrbn_mUeSo
    Regards  Roy Joyson
    Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.
    Roy Joyson

  • Person and Group column in Document Information Panel in Word

    Hi All,
    Environment: SharePoint 2010 and Claims based Authentication.
    We have a library with "Person and Group" column, "Choose from:" is set to "All Users" and in the "Document Information Panel" when I click on the Address Book (book symbol) it doesn't open the popup to select  the
    user nor it resolves the ids that I put in.
    But if I change the setting for "Choose from:" to "SharePoint Group:" and select any group (tested randomly with some existing groups in that site), now when I click on the Address Book in the DIP it gives me the popup and also resolves
    the ids.
    Any help would be appreciated.

    http://social.technet.microsoft.com/Forums/sharepoint/en-US/868b7d59-06e7-437f-8a3e-5f49e51c7b8d/people-picker-render-error-in-document-information-panel
    Have you by chance looked at ULS logs or taken a network trace during the time the People Picker control is attempting to be rendered? 
    It seems to be a client-side issue. GPOs have been applied to "secure" Office2010.
    Have you ever heard of GPOs causing such issues? As far as I know the people picker is an ActiveX control. There are two settings in the GPO which have something to do with Active X:
    Active X Control Initialization
    Check Active X Objects
    Windows Internet Explorer Feature Control Opt-In
    Beaconing UI for forms opened in Infopath Filler Active X
    Bind to Object
    If this helped you resolve your issue, please mark it Answered

  • What is difference between distribution list and share point group? Can we add distribution list into person and group column of share point list?

    what is difference between distribution list and share point group? Can we add distribution list into person and group column of share point list?

    there is a workaround you can try, create audience and add DL to them and deal with the audience or convert DL to groups
    https://social.technet.microsoft.com/Forums/en-US/02f0d773-8188-4d94-a448-0c04d838b0cf/distribution-lists-in-sharepoint?forum=sharepointgenerallegacy
    Kind Regards,
    John Naguib
    Technical Consultant/Architect
    MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
    Please remember to mark your question as answered if this solves your problem

  • How do u get the Ipod touch to group compilations for browsing ?

    How do u get the Ipod touch to group compilations for browsing ?
    With Itunes 9 like earlier versions u have the option to group compilations for browsing, having the effect of not putting a huge list of artists in your view by artist list because they played one song on a compilation you have got. With my old Ipod classic this option was also available through the setting menu. Meaning my ipod exactly mirrored my itunes lists.
    I have recently purchased a ipod touch 32 and can find no settings that allow me to do the same. My artist list has risen from 200 to 400 because of this and makes finding albums by artists very annoying.
    I have looked on the itunes software and can find no mention of syncing this ability to the ipod either.
    Help
    Mike

    Yes i do this to group compilations in itunes.
    But when i then sync to the ipod touch the albums come up under compilations as desired but the artists also appear in the artist list which is not.
    On my old ipod classic it had a setting to group compilations the same as in itunes which would then remove these odd artists from the artist list.
    I can find no equivalent setting on the ipod touch
    Cheers
    Mike

  • Filter base on Person or Group column does not work correctly in sharepoint 2013

    I have a list that contain "Person or Group"column that set "Allow Multiple Selections" to yes.
    In sharepoint 2010 I create view and filter it base on this person or group column equal to [Me]. And it's work correctly.
    Now in sharepoint 2013 when I filter view, base on this person or group column equal to [Me], it does not show me any items, although list has data that person or group column set to me.
    What's wrong?
    Thanks.

    If you want to filter the list view when current user is in the group, then I recommend to use theMembership comparator in the
    query and add it to the view page in SharePoint Designer:
    <Where><Or><Membership Type="CurrentUserGroups"><FieldRef Name="AssignedTo"/></Membership><Eq><FieldRef Name="AssignedTo"/><Value Type="Integer"><UserID Type="Integer"/></Value></Eq></Or></Where>
    More reference:
    http://decodesharepoint.blogspot.com/2010/01/filter-list-views-by-user-groups.html

  • Can I get a query to get the output data like 4th column instead of 3rd col

    Can I get a query to get the output data like 4th column instead of 3rd column ?
    SQL&gt; select emp.deptno, empno, rownum from emp, dept where emp.deptno=dept.deptno;
    DEPTNO EMPNO ROWNUM
    10 7782 *1* *1*
    10 7839 *2* *2*
    10 7934 *3* *3*
    20 7369 *4* *1*
    20 7876 *5* *2*
    20 7902 *6* *3*
    20 7788 *7* *4*
    20 7566 *8* *5*
    30 7499 *9* *1*
    30 7698 *10* *2*
    30 7654 *11* *3*
    30 7900 *12* *4*
    30 7844 *13* *5*
    30 7521 *14* *6*
    14 rows selected.

    SQL> select emp.deptno, emp.empno,
      2    row_number() over(order by emp.deptno, emp.empno) rn,
      3    row_number() over(partition by emp.deptno order by emp.empno) dept_rn
      4  from emp, dept
      5  where emp.deptno=dept.deptno
      6  order by emp.deptno, emp.empno;
        DEPTNO      EMPNO         RN    DEPT_RN
            10       7782          1          1
            10       7839          2          2
            10       7934          3          3
            20       7369          4          1
            20       7566          5          2
            20       7788          6          3
            20       7876          7          4
            20       7902          8          5
            30       7499          9          1
            30       7521         10          2
            30       7654         11          3
            30       7698         12          4
            30       7844         13          5
            30       7900         14          6
    14 rows selected.Regards,
    Dima

  • Divide a string in order to get the distinct list level.

    Hi,
    I want to divide a string in order to get the distinct list level to relate this with a category table.
    The size of my list is dynamic and because of this I’m unable to find a way to do this!
    Here goes an example of what I need to do:
    Consider the following list:
    Category                Category_ID
    Age                     1
    Less than 3 months      1.1
    Less than 9 months      1.2
    Less than 1 year        1.3
    Risk                    2
    Danger                  2.1
    High                    2.1.1
    medium                  2.1.2
    low                     2.1.3
    If I have a row that has category_id "2.1.3" I want to present values as:
    "Risk.Danger.Low"
    If I have a row that has category_id "1.1" I want to present values as:
    "Age.Less than 3 months"Any hint on what I should search in order to accomplish this?
    This will be used to produce a report. This report will contain a few thousand rows and the categories will be around 100.
    Thanks,
    Ricardo

    Hello
    I think this is a job for sys_connect_by_path....
    with p as
    (   select 'Age'             descr  ,'1' cat from dual union all
       select 'Less than 3 months'      ,'1.1' cat from dual UNION ALL
       select 'Less than 9 months'      ,'1.2' cat from dual union all
       select 'Less than 1 year'        ,'1.3' cat from dual union all
       select 'Risk'                    ,'2' cat from dual union all
       select 'Danger'                  ,'2.1' cat from dual union all
       select 'High'                    ,'2.1.1' cat from dual union all
       select 'medium'                  ,'2.1.2' cat from dual union all
       select 'low'                     ,'2.1.3' cat from dual
    SELECT
        cat,
        LTRIM(SYS_CONNECT_BY_PATH(descr,'.'),'.') route
    FROM
            SELECT
                descr,
                cat,
                SUBSTR(cat,1,INSTR(cat,'.',-1)-1) parent
            FROM
                p
    START WITH
        parent IS NULL
    CONNECT BY
        PRIOR cat = parent
    SQL> with p as
      2  (   select 'Age'             descr  ,'1' cat from dual union all
      3     select 'Less than 3 months'      ,'1.1' cat from dual UNION ALL
      4     select 'Less than 9 months'      ,'1.2' cat from dual union all
      5     select 'Less than 1 year'        ,'1.3' cat from dual union all
      6     select 'Risk'                    ,'2' cat from dual union all
      7     select 'Danger'                  ,'2.1' cat from dual union all
      8     select 'High'                    ,'2.1.1' cat from dual union all
      9     select 'medium'                  ,'2.1.2' cat from dual union all
    10     select 'low'                     ,'2.1.3' cat from dual
    11  )
    12  SELECT
    13      cat,
    14      LTRIM(SYS_CONNECT_BY_PATH(descr,'.'),'.') route
    15  FROM
    16      (
    17          SELECT
    18              descr,
    19              cat,
    20              SUBSTR(cat,1,INSTR(cat,'.',-1)-1) parent
    21          FROM
    22              p
    23      )
    24  START WITH
    25      parent IS NULL
    26  CONNECT BY
    27      PRIOR cat = parent
    28  /
    CAT   ROUTE
    1     Age
    1.1   Age.Less than 3 months
    1.2   Age.Less than 9 months
    1.3   Age.Less than 1 year
    2     Risk
    2.1   Risk.Danger
    2.1.1 Risk.Danger.High
    2.1.2 Risk.Danger.medium
    2.1.3 Risk.Danger.lowHTH
    David
    Edited by: Bravid on Sep 2, 2011 2:50 PM

  • Person or Group column problem

    Hi, I have quite tricky problem with Person or Group column. We use that column in quite many places. When I create new item or edit list item properties I can find person just fine for example with lastname and choose it but when I save that
    item the persons name changes to someone else of our users.
    What I noticed is that if I search person with beginning of their email address (firstname.lastname) everything is good even after I save the item. With some persons it works even if I find them with lastname.
    Is there something to do with users ID in Site Collection hidden user information list vs User Profile Database?
    Any ideas. Thank you.
    Miikka

    Hi Miikka,
    can you try cleaning up the user information list via powershell and reconfigure the userprofile sync.  following url contains the powershell script for user information clean up
    http://blog.fpweb.net/how-to-clean-up-sharepoint-user-information-list-with-powershell/#.VPrbn_mUeSo
    Regards  Roy Joyson
    Please remember to mark your question as "answered"/"Vote helpful" if this solves/helps your problem.
    Roy Joyson

  • How to get string (specified by line and column) from txt file with labview

    Hi everyone
    How to get string (specified by line and column) from txt file with labview
    thx 
    Solved!
    Go to Solution.

    As far as I know, a text file has no columns.  Please be more specific.  Do you mean something like the 5th word on line 4, where words are separated by a space, and lines are separated by a newline character?  You could the Read from Spreadsheet String function and set the delimiter to a space.  This will produce a 2D array of strings.  Then use index array and give the line number and column number.
    - tbob
    Inventor of the WORM Global

  • How can I get the table name of my column?

    I'm using the JDK 1.3 trying to get a table name of a column from a result set. Regardless of what driver I'm using (ODBC Bridge/Oracle) I always get a null returned. Does this method work?
    If not, if I'm doing an SQL query that uses more than 1 table and each table has a return of the same column name, how do I distinguish which table the column is from. Thanks

    You can use ResultSetMetaData interface and method
    String getTableName(int column)
    This should return you the table name.
    To get ResultSetMetaData object, you can use
    ResultSetMetaData getMetaData()
    method of ResultSet interface.
    HTH

  • How can I get the value of a custom property from a resource object?

    I am trying to get the value(s) of a custom property, called "status" within a method. The method has an object of type IResource available to it.
    I have tried the following:
    PropertyName propName = new PropertyName("","status");
    value = res.getProperty(propName).toString();
    However, I am getting a NullPointerException when I try to create the PropertyName instance.
    Is there a better way to get the value of a specific property from a resource object?
    Thanks,
      Tom

    Thanks Praveen.
    I was missing the default namespace of "http://sapportals.com/xmlns/cm" - I thought I could just pass an empty string for the namespace, but it looks like I must always specifiy, even if it is default.
    Tom

Maybe you are looking for

  • How i can connect WAS to SAP R/3?

    Hi all, I want to Access data from  internet (one website) some expert told me u can acces direclty by connecting WAS . so how i can do it in ABAP?

  • Connecting Apple TV 2 to iMac

    Is there any way that i would be able to use my imac an external display for my apple tv 2?? i belive i have the right wires to do it but am unable to navigate settings on the imac to get it to work. Hope someone can help George

  • Line-in not working with microphone?

    Line-in not working with microphone. I have Mac Mini Intel 1.83 GHz with 10.4.8 I have tried plugging 3 microphones into the line-input on the back, also on my wife's Mac Mini (same model, os), but I cannot get to record into the Mac. I've been into

  • Client 11 R2

    Hello Everyone, I am using Oracle XE with Client 11 R2 on Win 7 Pro 64 bit. I am using Oracle table in Access as linked tables and when try to update or delete on any of the linked table only one row is being updated or deleted. After looking into th

  • Dodo does not support the Blackberry Bold 9900 - can this be fixed?

    Hi there, Could someone help me with this please? I have a contract with Dodo and they don't seem to be able to support the Bold 9900...is this correct? If so, can this be rectified please? Kind Regards