WSS, doc libs & lists, Calculated columns involving [Me]

Someone on the Internets was asking about how to create a calculated column on a list that would show a value formatted as "[User] – [Status] – [Location]" as in "Paul Galvin – Drinking [free] Beer – The Beach".

Paul would go in and update his entry in the list and the calculated column would update appropriately.  The [User] should default to the the user entering/updating the list.

A calculated column cannot use "volatile" functions such as [Me] or [Today].  I solved it in a test environment with these steps:

  1. Create a text column named "Current User".
  2. Set its default value to [Me]
  3. Create a calculated column called "Calc Test".
  4. Set its value = [Current User]

I went in, added an item to the list and it worked.

9 thoughts on “WSS, doc libs & lists, Calculated columns involving [Me]

  1. Richard Harbridge

    Hello Paul,

    Without meaning to I think you just figured out a way to get around a serious InfoPath/SharePoint issue I have been having.

    Basically I can get the domain\username of users but then cannot use [Me] filters and other powerful SharePoint functionality. But by using something like this, it should work around that issue, by allowing me to compare two text columns (single line) rather than a people and groups column.

    Time to give it a try.

    Thank you,
    Richard Harbridge

    Reply
  2. Christophe Humbert
    Am I missing something? Your example shows the user name in clear ("Paul Galvin"), but when I test this I actually get the login (which somehow defeats the purpose, as announcing that "DOMAIN\username is drinking a beer" doesn’t sound that cool…).
    Reply
  3. No name
    Hello.
    I’m trying to use a CAML query against the Sharepoint web services in order to filter the items modified by [Me] and some other options. Do you know how to do that because I haven’t found anything yet?.
    I’ve tried GetListItems with the filtering query and a view that has a filter with  Modified By = [Me], but the view is ignored when using a query.
    Thanks.
    Reply
  4. Patrick Rote
    I did your tirck Paul.
    But when i view the list i see only [Me] and not my username.
    When i created the calculated column i set it to [Current User] using the formula add button.
    Is that right?
    Let me know
    Thanks
    Reply
  5. Paul Galvin
    Sadly, I don’t see any way to do that without writing an event handler.  Even If change the presentation of the "Person or Group"  to simple "Name" (as opposed to the more complex "Name with Presense") it is still disallowed.
     
    –Paul Galvin
     
     
    Reply
  6. Drew

    Paul,
    Thank you for that solution.  It worked great.  Expanding on your solution, would you have any idea how to set calc test = Current User if you want current user to be a People Picker field with only people selected?

    Thanks again.

    Drew

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *