ReplaceString function in Workflow
Hi I have problem with the ReplaceString function in a action workflow. What I need to do is to replace a attribute value on a person/user with an empty string by using a workflow, meaning delete the value in the attribute. And as documented on http://technet.microsoft.com/en-us/library/ff800820(WS.10).aspx "NewValue can be an empty string “”. Neither String nor OldValue can be empty." this should work. But it does not work, if i leave the NewValue string empty the OldValue is not replaced, if i type "" in the NewValue string the OldValue is replaced with "". If I put any value in the NewValue string the old value will be replaced with this value, so the function only works if NewValue is not empty? Has anyone any idea on why it's not works or how to solve it. /Mikael
July 8th, 2010 12:16pm

Hi Mikael! Empty string is a valid value in FIM so setting a string property to empty string doesn't actually clear or delete it. If you really want to clear an attribute value you must use a custom workflow or activity that uses the UpdateResourcesActivitity and pass it an UpdateRequestParameter with a null value for your attribute. If you wish to set an attribute value to an empty string using the Function Activity available from FIM portal you shouldn't use the ReplaceString function - instead use a constant string that you leave empty. I admit the behavior sounds strange for the ReplaceString function when leaving NewValue empty especially since the ReplaceString uses the .Net String.Replace function that allows you to replace parts of a string with an empty string but I don't have a solution for you regarding this. //Henrik Henrik Nilsson, ILM/FIM MVP Blog: http://www.idmcrisis.com Company: Cortego (http://www.cortego.se)
Free Windows Admin Tool Kit Click here and download it now
July 8th, 2010 1:53pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics