Symantec IGA

Expand all | Collapse all

Identity Portal - Populate Dropdown with SQL Data

Jump to Best Answer
  • 1.  Identity Portal - Populate Dropdown with SQL Data

    Posted 08-01-2018 04:25 AM

    Currently as I know, we can hard code the dropdown data using following method.

     

    First dropdown "Department" is based on hard coded value using options

     

    Second dropdown "Title" is based on some hard coded script value.

     

    Sample Dropdown value

     

    In most of the situation, customer data are always come from SQL table. How can we populate dropdown data from SQL table ? 

     

    Can anyone provide some example ?



  • 2.  Re: Identity Portal - Populate Dropdown with SQL Data
    Best Answer

    Posted 08-01-2018 11:57 AM
      |   view attached

    Here is an example from orejo01

    1. In your DB schema run create table countries(id NUMBER(5) PRIMARY KEY, STATE VARCHAR(20));
    2. Populate this table with the data from DB_Insert.sql from the zip.
    3. Add a custom JBoss DS named STATES-DS which points to your schema.
    4. In IP add a plugin with the javascript code from plugin.js from the zip.
    5. In IP add an initialization handler code for your form from init-handler.js from the zip.


  • 3.  Re: Identity Portal - Populate Dropdown with SQL Data

    Posted 08-01-2018 10:19 PM

    Very useful information, thanks Gil.



  • 4.  Re: Identity Portal - Populate Dropdown with SQL Data

    Posted 08-01-2018 11:45 PM

    My SQL query is returning a SORTED result

    But when display in form, it is not sorted...how can i fix this ?



  • 5.  Re: Identity Portal - Populate Dropdown with SQL Data

    Posted 08-02-2018 01:32 AM

    is ok, i found a way to sort the result.

    added ".sort()" on the variable success.returnValue

    then dropdown result show -> sorted.



  • 6.  Re: Identity Portal - Populate Dropdown with SQL Data

    Posted 08-02-2018 09:20 AM

    You can also do the sorting directly on the SQL level - let the DB to the hard work - they are optimized for this.

    Sorting on the client (i.e. the browser) depending on the size of the array is less efficient. 

    SELECT * FROM Customers ORDER BY Country;



  • 7.  Re: Identity Portal - Populate Dropdown with SQL Data

    Posted 08-02-2018 10:16 PM

    Based on my finding,  the SQL query result is already sorted. When the result(array) pass into GUI, it is not sorted. 



  • 8.  Re: Identity Portal - Populate Dropdown with SQL Data

    Posted 08-02-2018 03:44 AM

    Hi Gil,

    I manage to load "Country" value from a SQL table into a dropdown in Create New Employee form,

    but for Modify Employee form, my Existing Employee Country's value is "Japan", when loaded Country into dropdown from SQL table, the existing country value is not selected.

     

    How can I pre-select existing Country(that belong to existing Employee) value in dropdown ?