Layer7 Identity Management

Expand all | Collapse all

Update a field based on selection of another field

Jump to Best Answer
  • 1.  Update a field based on selection of another field

    Posted 08-11-2014 09:41 AM

    Hi,

     

    I need to update one IM task screen field based on the selection of another field. Is there a way to do this using Logical Attribute or BLTH API's? Preferrbaly I need to do it using Logical Attribute API.

     

    toPhysical() and validate() are called after the user clicks the Submit button. I need to run the logic (to poupulate another field)  whenever a user selects a value from an option list.

     

    Thank you,

     

    Arij



  • 2.  Re: Update a field based on selection of another field

    Posted 08-12-2014 05:33 AM

    Hi ArijQ,

    I had the same scenario where a user selects and option from a drop list and other fileds (actually 4 fields) gets populated based on the option he selected.

    Heres what I had done:

     

    1. Created a "select box data" under System menu
    2. My field which the user selects value from is a dropdown style with source as "select box data"
    3. My dependent fields have source as "depends on another field" and then specified the field name. You can set preserve non-options to yes/no  and validate on change option as wellbased on what u want.
    4. Once all done run the task and I think it should achieve what u want.

     

    *Tip: if you have a long list creation of the select box data might be tedious task so if you have a preexisting list , you can export it into xml and then modify the tags to fit in your list.much easier this way.

     

    Hope this helps

    Gaurav



  • 3.  Re: Update a field based on selection of another field

    Posted 08-12-2014 09:12 AM

    Gaurav, I like the idea of what you've done. Your depends on another field attributes are you displaying them or populating them depending on the selected data?

     

    Arij, were you wanting to actually populate or modify the 'depends on another field' attributes according to the first field selected?

     

    Thank you,

    Glenda



  • 4.  Re: Update a field based on selection of another field

    Posted 08-12-2014 09:26 AM

    Thank you Gaurav for you help.

     

    Glenda here is actually what I want.

     

    Our organization has multiple sectors and each sector has multiple locations. There are thousands of locations. Right now I have two LAH that populate two drop down option lists, viz., Sectors and Locations.

     

    When a user selects a sector, I want to filter down the Locations options list to show only those locations that belong to the selected sector.

     

    I do not know where to apply this filtering logic.

     

    Regards,

     

    Arij



  • 5.  Re: Update a field based on selection of another field

    Posted 08-12-2014 09:37 AM

    My depends on fields data gets populated based on what the user selected in the primary field. example my primary field is called office and stores office location codes and its a drop down list. So when the user selects any office location code, the other dependent fields (address, county etc) gets populated.



  • 6.  Re: Update a field based on selection of another field

    Posted 08-12-2014 09:53 AM

    Hi Gaurav,

     

    Where did you write the logic to pick up relevant address, country, etc. based on the selected office location code?

     

    Arij



  • 7.  Re: Update a field based on selection of another field
    Best Answer

    Posted 08-15-2014 05:14 AM

    Hi Arij

    Sorry for the late reply. As told earlier we have done the mapping is in the xml file of the selct box data and its typically in a hierarchical manner example

    <places name="places" displayName="places">
         <country name="AU" displayname="Australia">
              <state name="VIC" displayname="Victoria">
                   <city name="MEL" displayname="Melbourne"/>
                   <city name="GEEL" displayname="Geelong"/>
                   <city name="BAL" displayname="Ballarat"/>
              </state>
              <state name="NSW" displayname="New South Wales">
                   <city name="SYD" displayname="Sydney"/>
                   <city name="NCL" displayname="Newcastle"/>
                   <city name="WOD" displayname="Wodonga"/>
              </state>
              <state name="QLD" displayname="Queensland">
                   <city name="BRIS" displayname="Brisbane"/>
                   <city name="CNS" displayname="Cairns"/>
                   <city name="TVL" displayname="Townesville"/>
              </state>
         </country>
    <country name="UK" displayname="UK">
              <state name="SU" displayname="Surrey">
                   <city name="LON" displayname="London"/>
                   <city name="READ" displayname="Reading"/>
              </state>
              <state name="WLS" displayname="Wales">
                   <city name="CDF" displayname="Cardiff"/>
                   <city name="SWN" displayname="Swansea"/>
              </state>
         </country>
    </places>
    

     

    So based on the country selected the other fields will give you option of the relevant state in the dependent field.

    You can read more at

    https://support.ca.com/cadocs/0/CA%20Identity%20Manager%20r12%205%20SP5-ENU/Bookshelf_Files/HTML/index.htm?toc.htm?SelectBoxData_XMLFile.html

    Hope this helps.

    Gaurav



  • 8.  Re: Update a field based on selection of another field

    Posted 08-17-2014 12:41 PM

    Thank you indeed Gaurav.

     

    That is just what I wanted. I was trying to do the same using Logical Attribute Handler which is much more tough and not as neat as SelectBoxData

     

    Thank you once again.

     

    Arij