Monday 7 March 2016

Get user profile properties in a SharePoint list workflow


I have created a SP list called "Staff Info" with the below columns:

Field Name
Field Type
Employee   
Person or Group
Manager    
Person or Group
Employee Name           
Single line of text
Manager Name         
Single line of text
Employee Email Address       
Single line of text

To get user profile properties in a SharePoint list workflow, open the list in Internet Explorer >  From Top Ribbon, select Workflow Settings > Create a Workflow in SharePoint Designer > Select SharePoint Designer 2013 > fill in the Name and for Platform Type, choose SharePoint 2010 Workflow.
In SP Designer, in the edit workflow page, add the Action: Set Field in Current Item. 
Click field > choose the Manager
Then, click value > choose fx to define the workflow as the following:

 

To the same for Employee Name, Manager Name and Employee Email Address as below.

Employee Email Address :

   

Manager Name:

   

Employee Name:
 

Save your workflow and publish it. 
(Change the workflow settings to run when a new item is created and modified)

Now if you add a new employee to this workflow, Employee Name, Manager Name and Employee Email Address will be updated from User Profile Properties (UPP).

Now, when a user wants to add an employee info to this list, just need to pick the employee from the people picker and there is no need to fill these fields (e.g. the manager column or employee name) , you can make these files hidden from so users will not see them when adding/editing employee information to the list.

To do this, open the item content type,

 

Select the filed (e.g. Manager) and make the column hidden
         

No comments:

Post a Comment