Working with User Profile Properties in SharePoint Online
After a somewhat more complicated read in yesterday’s skybow Advent Cookie, today a simple one, but a really cool one: using User Profile properties in any expression of skybow Expression Language skybow Solution Studio, skybow Rich Forms and skybow Action Links.
What that means? Basically, that you can make your forms and pages dynamic, based on the user profile data, which heavily extends SharePoint’s permissions story. While SharePoint permissions are usually maintained by Site Collection administrators, User Profile data is usually maintained on company level, and thus by admins.
Imagine, you need to prepopulate a field in SharePoint form with the Office Location of your user – that is not an information a Site Collection administrator has, but it is something that can be found in Azure Active Directory, and thus in User Profile.
Setting the office default value with skybow Solution Studio or Rich Forms is a piece of cake:
The same way, you can make a form, a part of a form (container control) or a field visible or accessible only for the people from a certain department. While this is virtually impossible to achieve through standard SharePoint permission constructs, it is a simple thing with skybow Solution Studio. In the next screenshot, we will set the visibility of the “Item Catalog Number” field only for the people from the “Purchasing” department:
While skybow expression builder gives you the full access to the standard user profile properties, as seen in the previous examples, working with custom properties is fully supported, too.
There is a helper function “[[@User.GetCustomProfileProperty()]]” which enables you to get any custom property you might have set for the user:
This way you can make your SharePoint forms and data behave dynamic, based on the custom user profile properties from your AAD.
And all this is achievable literally within seconds. Because skybow. :)