FIM 2010 R2 - How to clear a number attribute using workflow
A one simple question. How to clear a number attribute or set it to null using a workflow?
May 18th, 2015 3:50am

Hello,

from what I remember this can not be done with OOB functions.

You need to use a custom activity, you can write one (delete Attribute value) or use powershell activity to clear the Attribute through webservice.

/Peter

Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 4:02am

+1 for Peter's input.

You could use my Code Run activity and just return a null for the value - that would clear the value. Have a look here - http://fimactivitylibrary.codeplex.com/wikipage?title=Code%20Run&referringTitle=Documentation

Something like this -

using System;

public class FIMDynamicClass
{
    public object FIMDynamicFunction()
    {
        return null;
    }
}

May 18th, 2015 7:02am

+1 for Peter's input.

You could use my Code Run activity and just return a null for the value - that would clear the value. Have a look here - http://fimactivitylibrary.codeplex.com/wikipage?title=Code%20Run&referringTitle=Documentation

Something like this -

using System;

public class FIMDynamicClass
{
    public object FIMDynamicFunction()
    {
        return null;
    }
}

Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 7:25am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

May 18th, 2015 7:25am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

  • Edited by Leo Erlandsson Monday, May 18, 2015 2:31 PM
  • Marked as answer by 2xTsei 22 hours 14 minutes ago
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 11:24am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

  • Edited by Leo Erlandsson Monday, May 18, 2015 2:31 PM
  • Marked as answer by 2xTsei Tuesday, May 19, 2015 9:12 AM
May 18th, 2015 11:24am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

  • Edited by Leo Erlandsson Monday, May 18, 2015 2:31 PM
  • Marked as answer by 2xTsei Tuesday, May 19, 2015 9:12 AM
Free Windows Admin Tool Kit Click here and download it now
May 18th, 2015 11:24am

Hi Soren,

By default there is no FIM direct way of setting a null value. You have to use a Powershell activity (or other) to Unset an attribute.

Try the below i used to unset the OTP email address. Not ideal but meets the needs....

Add-PSSnapin FimAutomation

$objID = $fimwf.TargetId.Guid

$ImportState = [Microsoft.ResourceManagement.Automation.ObjectModel.ImportState]

$importObject = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportObject

$importObject.ObjectType = "Person"

$importObject.TargetObjectIdentifier = $objID

$importObject.SourceObjectIdentifier = $objID

$importObject.State = $ImportState::Put

$importChange_OTP = New-Object Microsoft.ResourceManagement.Automation.ObjectModel.ImportChange

$importChange_OTP.Operation = 1

$importChange_OTP.AttributeName = "msidmOneTimePasswordEmailAddress"

$importChange_OTP.FullyResolved = 1

$importChange_OTP.Locale = "Invariant"

if ($importObject.Changes -eq $null) 

{

$importObject.Changes = $importChange_OTP

else 

{

$importObject.Changes += $importChange_OTP

}

$importObject | Import-FIMConfig -uri "http://localhost:5725"

May 19th, 2015 5:08am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

Hi

Yes, actually I can. I definately tested it and I couldn't set it it but now I can. Thanks! So actually there is now at many ways to do that! Thanks!

  • Marked as answer by 2xTsei 22 hours 14 minutes ago
  • Unmarked as answer by 2xTsei 22 hours 14 minutes ago
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 5:14am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

Hi

Yes, actually I can. I definately tested it and I couldn't set it it but now I can. Thanks! So actually there is now at many ways to do that! Thanks!

  • Marked as answer by 2xTsei Tuesday, May 19, 2015 9:11 AM
  • Unmarked as answer by 2xTsei Tuesday, May 19, 2015 9:11 AM
May 19th, 2015 9:11am

Couldn't you just set the attribute to " " (space) using the OOB Function Evaluator?

This works at least for other types of attribute you want to set to null.

Edit:

Just tried this using the OOB Function Evaluator on an attribute of type "Integer". Works.

Using FIM 2010 R2 4.1.3634.0.

Hi

Yes, actually I can. I definately tested it and I couldn't set it it but now I can. Thanks! So actually there is now at many ways to do that! Thanks!

  • Marked as answer by 2xTsei Tuesday, May 19, 2015 9:11 AM
  • Unmarked as answer by 2xTsei Tuesday, May 19, 2015 9:11 AM
Free Windows Admin Tool Kit Click here and download it now
May 19th, 2015 9:11am

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

Other recent topics Other recent topics