Set array as a dropdown in User Creation Process

Hello,

i was thinking about how to realize following szenario:

In the user creation process the company is chosen in the first step. As a result of this choice i want to fill the department attribute with a specific sets of departments (every other company has different department names).

I tried this but its not working (function onGetEffectivePolicy):

if ($company -eq "test"){
$array = @("123422", "test")
$Request.SetEffectivePolicyInfo("department", $Constants.EDS_EPI_UI_GENERATED_VALUE, $array)
}
}

Can you help me with this? Thanks in advance!

Regards,

Michael

Parents
  • Here's the combination of lines I usually use to populate a dropdown from an array:

    $MyArrayOfItems = @("123422", "test")

    $Request.SetEffectivePolicyInfo('SomeAttribute', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$MyArrayOfItems)
    $Request.SetEffectivePolicyInfo('SomeAttribute', $Constants.EDS_EPI_UI_GENERATED_VALUE, [string[]]$MyArrayOfItems[0])
    $Request.SetEffectivePolicyInfo('SomeAttribute', $Constants.EDS_EPI_UI_RESTRICTED , $true)

    Note the casting of the array to a "string list".  It's weird but it works.

    If you really need to do this programmatically, then this is the approach.

    You can (also) create static lists of dropdown items using a Property Value Generation rule within a provisioning policy.  This is simple and codeless.


    Here's an article about the codeless approach.


Reply
  • Here's the combination of lines I usually use to populate a dropdown from an array:

    $MyArrayOfItems = @("123422", "test")

    $Request.SetEffectivePolicyInfo('SomeAttribute', $Constants.EDS_EPI_UI_POSSIBLE_VALUES, [string[]]$MyArrayOfItems)
    $Request.SetEffectivePolicyInfo('SomeAttribute', $Constants.EDS_EPI_UI_GENERATED_VALUE, [string[]]$MyArrayOfItems[0])
    $Request.SetEffectivePolicyInfo('SomeAttribute', $Constants.EDS_EPI_UI_RESTRICTED , $true)

    Note the casting of the array to a "string list".  It's weird but it works.

    If you really need to do this programmatically, then this is the approach.

    You can (also) create static lists of dropdown items using a Property Value Generation rule within a provisioning policy.  This is simple and codeless.


    Here's an article about the codeless approach.


Children
No Data