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:
- Create a text column named "Current User".
- Set its default value to [Me]
- Create a calculated column called "Calc Test".
- Set its value = [Current User]
I went in, added an item to the list and it worked.
I don’t think (but have not verified) this will work in SharePoint 2007 – a calculated column is only updated when the item is edited so in this case [Me] will always be the user who last edited the item.
The same trick using [Today] no longer works – see this post for more details http://blog.pentalogic.net/2008/11/truth-about-using-today-in-calculated-columns/
Darn. Doesn’t look like I can get that ‘workaround’ to show the user information in the column.
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
But when i view the list i see only [Me] and not my username.
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