“Created” equals “Current user” not working as it should?

September 29th, 2008 | Categories: SharePoint

When using Data view in SharePoint Designer and trying to make conditional formatting on something that current logged in user has created, I followed the usual way. Selected the elemtn, clicked Conditional Formatting and set the filter to "Created" — "equal to" — "Current user" like shown in the figure below:

image

Surprise – even if I was logged in like me, I couldn’t see the formatting on items I’ve created. The feature works with filter (not XSLT).

The problem is the presence information and link that SharePoint uses to store the author. The following worked for me.

1. Switch to code where you have the conditional formatting. Find string like something below:

<xsl:if test="normalize-space(@Author) = $UserID">

and change it to following:

<xsl:if test="substring-before(substring-after(string(@Author),’&quot;&gt;’),’&lt;/A&gt;’) = $UserID">

(note the change marked with bold)

and the thing should display items which you like logged in user have created.

Oznake ponudnika Technorati: ,,

  1. September 30th, 2008 at 00:52
    Reply | Quote | #1

    You can also just change the Comparison operator to ‘Contains’

  2. September 30th, 2008 at 08:34
    Reply | Quote | #2

    Boris, off-topic for this post, but post your conference details that were earlier here to this Microsoft forum.

    http://social.technet.microsoft.com/Forums/en-US/sharepointcommunity/threads/

    Mike

  3. Boris Gomiunik
    October 6th, 2008 at 20:21
    Reply | Quote | #3

    True, Ian :) . I was just being uber-secure :)

  4. akshaya
    March 25th, 2009 at 07:31
    Reply | Quote | #4

    hi,
    for me its showing Type miismatch error in the place &quot;
    my string is like
    <xsl:if test="substring-before(substring-after(string(@Author),’&quot;&gt;’),’&lt;/A&gt;’) = $UserID">
    if i used > means its returns the value after >
    but its saying error if i used "

    plz………help me

    thanks in advance

  5. Rinku
    June 1st, 2009 at 05:55
    Reply | Quote | #5

    Thanks a lot. I was wondering how can I call the template in xsl:for-each for the author n then count the rows and show a no records!! message.

  6. mery
    March 3rd, 2011 at 13:09
    Reply | Quote | #6

    hi, i also have the problem with this conditional formatting, in my page not appears an item that current user id are created…. how i work?