Dynamic Drop-Down List Value Addition in Identity Portal Forms
search cancel

Dynamic Drop-Down List Value Addition in Identity Portal Forms

book

Article ID: 12271

calendar_today

Updated On:

Products

CA Identity Manager CA Identity Governance CA Identity Portal CA Identity Suite

Issue/Introduction

Identity Portal forms retrieve data directly from Identity Manager. Administrators may require the addition of supplemental values to these dynamic drop-down lists beyond the default retrieved data. This article outlines the procedure to extend dynamic drop-down lists by injecting custom values during the initialization process.

Environment

Identity Portal

Resolution

To add custom values to a dynamic drop-down list, inject code into the initialization handler of the specific attribute. The following procedure demonstrates how to retrieve values from Identity Manager and push them into the dynamic drop-down list.

  1. Navigate to the attribute configuration within the Identity Portal form.
  2. In the initialization code section of the attribute, insert the following JavaScript:
var userID = api.getRequester().userData['UserId'][0];

return api.server(['getOffice', userID]).then(

function(success) {

     var arr = $.parseJSON(success.returnValue);

     for (i = 0; i < arr.length; i++) {

          prop.options.push({"name":arr[i].officeName,"value":arr[i].officeValue});

     }

}, function(error) {

     prop.errors = ['Error in initialization handler'];

});
  1. Customization:
    • The api.server call fetches values from Identity Manager.
    • To add additional custom values, use prop.options.push() to append new name/value pairs to the object.
  2. Verification: Save the form configuration. The return statement ensures the form waits for the server call to resolve before populating other properties, ensuring data integrity.