Update Manager from User Profile?

  • 2 November 2015
  • 4 replies
  • 1 view

Badge +5

I have a list where applications have been submitted and sent for approval to their manager. I am trying to find a way to everyday compare manager field in list to manager field in user profile of user to ensure manager is correct. If manager does not match user profile, then update manager in list.

 

Thanks


4 replies

Badge +5

You would create a site workflow and schedule it to run daily.  In the workflow, query the list, retrieving the ID, User, and Manager field. Insert a For Each action.  Query the User profile and compare to the returned manager to the Manager field.  If they are different, update the item using the ID as the filter. 

 

I assumed you would want to filter the initial query to ignore items that have already been approved.

 

 

 

This would update the manager field in your list.  The next problem is that you have a workflow running on those items, presumably with a task assigned to their previous manager.  The simplest solution is to create a list workflow that starts when an item is modified and meets certain conditions.  Manager (previous value) field does not equal the Manager.  Terminate the previous workflow.  Start the workflow again.  The workflow in this case would be your normal approval workflow.

 

Badge +5

Hi Jeremiah,

Thanks for your detailed response. This looks great, however, I am having issues with Query User Profile action. I am getting error "User profile does not exist for user". I am not sure what this action is trying to look for (i.e. format for input).

Badge +5

All working now. Figured it out. Thanks a lot for your help

Badge +5

Hi Frank

Correct answer has been marked already

Reply