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

  • 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.


  • To add on a little more to JohnnyQuest's reply, if you are wanting the contents of a dropdown list (Departments) of be dependent on what might be selected in another dropdown list (Company), please have a look at the Active Roles SDK for "Creating bound list-boxes" and the constant EDS_EPI_UI_RELOAD_EPI_BY_RULE to be used in the onGetEffectivePolicy Event Handler.

    The following KB article also has a sample script.

    How to create a Bound List-box with 4 Levels (4244019) (oneidentity.com)