Target Audiences Column appearing as GUID

Posted 13 May 2015 12:00 AM by Vishan Sondhi, SharePoint Consultant @ ClearPeople

13/05/2015   

So, I have been working on a project for a customer who wanted to Target Audience individual list items in SharePoint... Simple task, right?

I allowed the management of content types on my list and added in the ‘Target Audience’ site column which is available to us out of the box.  This bit all works fine.
The actual problem arises when you start to audience target the list items.

When you audience target list items, the audience appears as a GUID in the list view (as below)

 
But if you remove the audience from the first list item, the audience does not appear as a GUID (as below)

 
So basically, if the first item in the list has an audience, then ALL the items appear as GUIDS.

As soon as you remove the audience from the first list item, the audience name loads correctly i.e. doesn't display the GUID.

I did a bit of further reading on this and a lot of people have said this issue is by design, but surely it can’t be a design issue? No one wants to see a GUID in the view.

I found this issue is evident on all on-premise versions of SharePoint (2007, 2010 and 2013) and SharePoint Online.

Having contacted Microsoft about the issue; they confirmed that this issue is a Bug in SharePoint and it has been there since 2007.

Microsoft reasoning

“This bug will not be fixed. SharePoint uses XSLT stylesheets to render list views. A list is rendered as an HTML table and the value of a field is rendered into the appropriate cell of the table by a simple XSLT template from the fldtypes.xsl file located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\LAYOUTS\XSL. And this issue relates to the .xsl file. ”

So there you have it folks, an unfixable bug in SharePoint. The current workaround is to remove the audience from the first item. I didn’t find this very appealing, nor a solution, so I had a little play around with it and have found a temporary fix which works for me.

 Temporary Fix to Audiences appearing as GUID

As the GUID on Target Audiences only appears on the first item in the list, we need to find a way of hiding the first item. Having tried to use filters on the view to hide the first ID – the problem still remained, (because the first item in the list will be item 2 If you hide item 1).

A solution that has worked for me was adding the snippet web part to the actual list and then adding a bit of code to it. See below:

1. Create a bogus item as the first item in the list. Make sure that this item has an ID of 1. (So it has to be the first item in the list)

 

 

 
2. Edit the list by selecting the cog in the corner and Edit Page

 
3. Insert the snippet web part on top of the list and insert the following code:
 <style>
.ms-listviewtable > tbody > tr:first-child{
   display: none;
}
</style>

3. Save the page

4. Voila!

 

 
The snippet is just basically hiding the first item in the list.

*I strongly recommend you try and test this before you insert any code onto a PROD environment.

Share:

Add your comment

 
 

 

Archive

Tagcloud

emplyee engagement staff satisfaction productivity Microsoft Teams Office 365 Yammer cms content management system agile GDPR Microsoft Graph collaboration Microsoft sharepoint 2016 upgrade migration SharePoint Online 2016 Tech Trends Digital Disruption Context marketing marketing SharePoint 2010 SharePoint 2013 TFS Git security kentico Analytics intranet jquery QA Quality Assurance testing digital workspace content management websites Sitecore sitecore marketplace sitecore module cloud Microsoft Cloud Storage digital strategy technical consulting sitecore modules Experience database Sitecore 7 Sitecore 8 support account management customer experience Data Storage windows azure cms integration front end front end development prototype Cloud Storage StorSimple Front-end Development Layout SharePoint 2013 colour palette UI design website design log viewer sitecore cms website Azure big data business-critical sharepoint accessibility android apple chrome clear people clearpeople debug emulator ios mobile testing opera resize adobe desktop flash ie10 internet explorer 10 metro windows 8 bcsp SharePoint Advanced System Reporter reporting framework ControlMode form control master page placeholder publishing console SharePoint 2007 SharePoint error search search results search values software testing testing scenario audit content information architecture retention schedules PowerShell QuickLaunch scripts SharePoint server 2010 business solutions metalogix replication replicator storagepoint stena technet UK Technet picture library slideshow web part RTM released to manufacturing caml caml query MOSS 2007 query infopath