Highlight document library rows based on who's logged in.

Hi Experts,

Thanks in advance for your time to read over this post/question.

I would like to know:

1) Is it possible to highlight a document library row based on who's logged into the SharePoint server?  Basically, the user logged in would see all of the documents "assigned" to them highlighted.

2) If this is possible, then could you please provide me with steps or sample code that would get me pointed in the right direction?

LVL 13
Andrew DerseIT ManagerAsked:
Who is Participating?
I would have two views on one list.

One view would be called "My Steps" and I would set this view to be the default view. Filters as descibed earlier.( in this view you don't need to include the field that contains person's name).

Then keep the Original All Items view which is created when you created the list ( in this view you want to include the field that contains person's name).

You could always create a page which shows first "My Steps" in a list view web part and then a second web part showing all items. ( Simply edit page add web part and select the list in question and select the view under edit web part properties).
You could either

1. Add a dataview web part to a page using SharePoint Designer. In this web part you can configure the colours used depending on the data of each item in your list/library.

2. Have you considered creating a view where you filter on Author=[Me] or Modified=[Me]. Then make this view the default.
Andrew DerseIT ManagerAuthor Commented:
Thanks for the info.

#2 is definitely what I was considering however, I need to filter based on a process step.  

Here's a little more detail:

When a user logs into SharePoint and navigate to the Documents Library, the documents are sorted by the "Process Step" that they are in.

Each user in the system is assigned to a "Process Step".

When a user logs in, I would like them to be able to just see their documents...is there a filter that I can set to filter out all documents that don't relate to their step?

Also, how would I be able to have them view all of the documents if they wanted to?  Sorry, I'm very new to SharePoint.

Thanks for your time.
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Andrew DerseIT ManagerAuthor Commented:
To further clarify, each user is in it's unique SharePoint Group that has access to a "Process Step" in the system.

I would like to know how to filter by telling the system to show documents that are in my "Process Step".  Is that possible?
Arer you using a workflow here?
Are you trying to display the documents or the tasks in the workflow?
Andrew DerseIT ManagerAuthor Commented:
I am using a workflow and I just need to display the documents.  There are no tasks.

The workflow is a VERY basic workflow that just checks to see who last modified the document and then sends an email to the next person in line.

So if person-x modifies the document and then puts it in Process Step #1, person-y gets an email.

They now wanted to highlight the rows for person-y when they logged into the system to show all of person-y's documents that are "assigned" to them based on their process step.

So if person-y is assigned to the Process Step #1, and they logged in, they wanted their files to be highlighted...but the modified by name is going to be person-x's name.

Hope this makes sense.
Ok, now we're getting there.

So in your workflow are you setting a field to the person-y (this can also bea group, that doesn't really make too much of a difference). If you are then you could filter on that field and set the filter to WhatEverField=[Me].

If you've got code that looks like this:
if step = step1 then email person-y
Then it might be a bit trckier. Then you could also set a Target Audience on the list item. And enable target audnice on the 'My Steps' View.

Andrew DerseIT ManagerAuthor Commented:
The steps look like this:

If Current Item:Process Step equals 0 - Product Management
    If Current Item:Modified By equals person-x
    //Nothing here...as we don't want to re-send an email to the person.
        Email 0 - Product Management

Then it proceeds to check for Process Step: 1 - Packaging Engineer...and so forth.
Andrew DerseIT ManagerAuthor Commented:
BTW person-x belongs to 0 - Product Management and person-y belongs to 1 - Packaging Engineer, etc...

Again, thank you so much for your time with this.
Andrew DerseIT ManagerAuthor Commented:
This worked for the end user.  We were able to create the two views for them and they lliked this option.

Thanks for your time.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.