I have a workflow that collects a user ID from a people picker field. This is pulled from the SharePoint user cache that comes ultimately from Active Directory.
Part of the workflow is to take that user ID and pull the associated Display Name of the user to use in email notifications and to display in the list. Often, people are picking a test account or admin account or service account from the people picker (because many of our people have multiple accounts in AD), and then the WF cannot find the display name and breaks.
Is there a way to have the WF check whether the account is an Admin or Test account (incorrect) or an actual person account (correct), and then perform a different action based on the result?
Solved! Go to Solution.
You could use "Query User Profile" action and select "First Name" and "Last Name" for the properties to retrieve. This Query User Profile action does have an error handling section and you could set a variable to check if it has gone into an error and take corresponding action.
Set Variable action does not have a built in error handling mechanism.
Thanks, Shrini. I'll look into query user profile action.
Can you provide any more details about how to setup separate actions based on the error handling function?
I assume I create a variable and store the error text or error occurrence in it. How do I then split off actions one way or another based on the result?
There are not many actions in Nintex that provides you with custom error handling mechanism , Query user profile action is one of the few which has inbuilt Error handling mechanism, so that the workflow does not error out if there was an error in querying values from UPS.
With regards to your second part of question you are correct you would need to store the error occurrence (boolean variable and may be error text .. if you want to be notified about it or log it in another variable) have an "Run If" action just after the Query User profile action. RunIf action will check if the error variable is true then do a set of actions (like notify/end the workflow etc), if the variable is false ( positive condition) then the actions inside "Run If" action wont be used.
Please mark as answered if it solves your query, would be useful for other folks who have similar query.
This works perfectly! Thanks for the help.
There's also an article here that discusses the same thing: https://community.nintex.com/community/build-your-own/blog/2017/03/02/error-handling-in-nintex-workf...