Update AD Object - Object data with empty value

Peter Bishop
Kilo Expert

I am using the "Update AD Object" in a workflow but if the user sets a field to an empty value the workflow fails with:

The attribute syntax specified to the directory service is invalid.Stack Trace: at System.DirectoryServices.DirectoryEntry.CommitChanges()at CommitChanges(Object , Object[] )at System.Management.Automation.DotNetAdapter.AuxiliaryMethodInvoke(Object target, Object[] arguments, MethodInformation methodInformation, Object[] originalArguments)

If there is data in the field the update works and propagates through to AD. The format of the Update AD Object is:

find_real_file.png

Is there a way for this to work if the value of "workflow.inputs.u_phone" is an empty string?

Thanks.

3 REPLIES 3

Albert13
Kilo Sage

Put an if statement before the update ad object block that checks to see if u_phone is empty.  If it i skip the block, if not process the block

Unfortunately that doesn’t work if the value needs to be cleared. For example, removing a home phone number. The user will clear it from the form but the If statement would prevent it from being cleared from AD.

Kalyani
Tera Contributor

Hi Peter,

If you want to update the AD user with empty data, please provide 'null' as the value while using the activity.

https://docs.servicenow.com/bundle/orlando-servicenow-platform/page/administer/orchestration-activit...

So it would be:

{"telephoneNumber":null}