6

I have a few properties stored against user profiles (both standard and custom properties) that I would like to show, based on the user that created an item, in library views.

For example, if the user profile service stored a property with information related to which country a user was based in then I could create a view that would let me group by the country of the person that created each item.

Is this possible?

3 Answers 3

2

sorry, too less reputation to add a comment...

Answer for:

Nice suggestion but the Show Field doesn't contain all properties from the user profile service. I can't see any settings within the user profile property settings page to get extra options to appear.

if you want to show custom properties in "Show Field" section of an SPUser field, you have to configure this fieldproperty in the User Profile Store as "Indexed".

Indexed properties are crawled by the search engine and become part of the People search scope schema. Only index a property if it will contain relevant information for people finding or if you want the data displayed in people search results.

UPS in CA >> Manage User Property >> Edit "Country" field >> Set "Indexed" to true and Save..

After that you have to start the "User Profile Service Proxy - User Profile to SharePoint Full Synchronization" Timerjob...

Greetings

1
  • You beat me to it @domsen123 - when I saw the question on the front page, I clicked it to add exactly this.
    – Omegacron
    Apr 2, 2015 at 17:48
1

You could create a column of type Person and select the field "Country" (Show field) to be displayed. Then you could create a workflow which will fill this column to the "user who created item", every time a list item is created.

After that you could sort your list based on this column.

1
  • 1
    Nice suggestion but the Show Field doesn't contain all properties from the user profile service. I can't see any settings within the user profile property settings page to get extra options to appear.
    – Perrin255
    May 27, 2014 at 15:31
1

I would suggest creating an event receiver on the item added (or item updated) event of the list. You can then quite easily acces the profile manager in code and populate your column with whatever profile value you need.

As an alternative you could probably also do this in client side script attached using the jslink property of the list but there might be limits to which fields you can pull back from the web service.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.