Update User profile smart service failing because the user's supervisor is not longer active

We are on Appian 17.3. 

We have a daily sync process where we use the LDAP Synchronization plugin to retrieve data from Active Directory. We are enhancing the process just now to maintain the supervisor field updated as well. Say the process ran 2 weeks ago and User A was assigned Supervisor A. Today Supervisor A gets deactivated so User A has no supervisor for a day or so. When Appian attempts to call the update user profile smart service, it is failing and I realize it is explained here: https://docs.appian.com/suite/help/18.2/Update_User_Profile_Smart_Service.html with the note If the user selected for the Supervisor field has been deactivated since the profile was last updated, an error is thrown and the process pauses by exception until a valid user or no user is entered for the field.

My question is how do I solve this? My rule is returning NULL for the supervisor for User A and I would like for the smart service to update the Supervisor field to NULL. Why can't it to that? What are my options? I don't want manual intervention since the one of the purposes of Appian is to automate processes. Thoughts?

  Discussion posts and replies are publicly visible

Parents
  • Hello,

    Just a heads up, you are on 17.3 but linked an 18.2 doc. Regardless, you should be able to wrap the Supervisor input in an expression like if(isuseractive(pv!supervisorUser),pv!supervisorUser,null)

    Is this what you were looking for?

  • Dylan, in terms of update user profile, 17.3 and 18.2 are the same. This is not what I wanted because the user already has a supervisor in my use case which is deactivated. How can I systematically update that user's supervisor now?
  • 0
    A Score Level 2
    in reply to erickp

    Sure.

    So as I understand your problem, a user has a supervisor that has been deactivated since the last LDAP sync and you want to set the supervisor to NULL until an active supervisor is synced. Since the current supervisor is deactivated, you can't run the Update User Profile smart service as you will receive an error, correct?

    If so, In the process model where you have the Update User Profile node we have the Supervisor input where we are able to write an expression for the value. In this case, this is where we would have the logic mentioned above, if(isuseractive(pv!supervisorUser),pv!supervisorUser,null).

    This way, if the user's supervisor is active, they will still be added. However if the supervisor is inactive, the supervisor will be set to NULL.

    Please let me know if I am still not understanding your question.

     

    **EDIT: It seems you need to extract the supervisor logic I listed above into a script task before the Update User Profile node, and set the "Overwrite All Fields" to True, otherwise null won't be evaluated. If you do this, you will need to make sure that all inputs are mapped correctly to prevent the loss of data for the appropriate fields.

  • 0
    A Score Level 2
    in reply to Dylan Salopek
    Hi Erick,

    Adding to , if you want to assign a new supervisor when the current supervisor is deactivate. Maybe you can edit the condition mention by Dylan to replace the null with a new value.

    if(isuseractive(pv!supervisorUser),pv!supervisorUser,pv!newSupervisorUser)

    Thanks
Reply Children
No Data