none
FIM 2010 R2 - How to clear a number attribute using workflow RRS feed

  • Question

  • A one simple question. How to clear a number attribute or set it to null using a workflow?
    Monday, May 18, 2015 7:48 AM

Answers

  • 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
    Monday, May 18, 2015 11:24 AM
  • +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;
        }
    }


    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt


    • Edited by Søren Granfeldt Monday, May 18, 2015 11:02 AM added code
    • Marked as answer by 2xTsei Monday, May 18, 2015 11:24 AM
    Monday, May 18, 2015 11:01 AM

All replies

  • 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


    Peter Stapf - ExpertCircle GmbH - My blog: JustIDM.wordpress.com

    Monday, May 18, 2015 8:01 AM
  • +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;
        }
    }


    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt


    • Edited by Søren Granfeldt Monday, May 18, 2015 11:02 AM added code
    • Marked as answer by 2xTsei Monday, May 18, 2015 11:24 AM
    Monday, May 18, 2015 11:01 AM
  • +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;
        }
    }


    Regards, Soren Granfeldt
    blog is at http://blog.goverco.com | facebook https://www.facebook.com/TheIdentityManagementExplorer | twitter at https://twitter.com/#!/MrGranfeldt


    Thanks, that worked! And yes, you have to use either PowerShell or Custom code for clearing a number attribute.
    Monday, May 18, 2015 11:24 AM
  • 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
    Monday, May 18, 2015 11:24 AM
  • 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"


    -Dhayanandh

    Tuesday, May 19, 2015 9:05 AM
  • 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
    Tuesday, May 19, 2015 9:11 AM