SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have listA and another ListB

When i a user views an item in ListB there is a custom button that the user clicks. Now when the user clicks the button i insert some rows into ListA which are: 1) The ID of the item in ListB 2) The username of the user.

So listA looks like this.

ID username Title
13 userB    Boy
15 userA    Trouble2
15 userA    Trouble2

In listB

ID Title
13 Boy
14 Girl
15 Trouble2

Now you can see this means that user A has clicked the item 15 twice which is Title Trouble2.(I mean ID 15 has been inserted twice see above)

So i would like to show a view like this(When userA logs in he sees the below)

ID username
13 Yes
14 No
15 Yes

Any ideas and thanks in advance

share|improve this question
I'm not sure that your examples match your question exactly. Do you want to avoid creating duplicates in List A or simply create a view which doesn't show them? Are you writing server-side or client-side code? Can you provide an example of your code so far? – Marc D Anderson May 28 '12 at 12:43
Marc what i'm simply after is if the userA logs in - I use the username and the ID to check each row and if it already exist "YES" if not "NO" Do you know what i mean? Thanks – naijacoder May 29 '12 at 4:06
up vote 0 down vote accepted

It sounds like you simply want to eliminate duplicates in your display of ListA for each user. (I still don't think your examples are consistent with what you are saying, exactly.) So you need to filter for the current user, and group on the ID column.

To do this, I'd use a Data View Web Part. Filtering for the current user is fairly straighforward. To eliminate the duplicates, I usually use the ddwrt:NameChanged function (Eliminating Duplicates in Data View Web Parts), though there is also some XSL magic you can use (XSL Alternative to Eliminating Duplicates Using ddwrt:NameChanged).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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