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.
Solved! Go to Solution.
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.
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).
Hello, Abhi Pathania, If this has worked out for you, please select a "correct answer" as it helps others on the community looking for correct answers find them. Thank you!
Yes, sorry, Abhi Pathania, we lost a lot of "correct answers" in a recent merge of spaces. Jive admins were able to recover those just yesterday. Thanks for coming back to look, tho!