Add values in form field through list

Hi everyone. I am making a form where I want to include lot of items in a field with dropdown. Copying one by one is a little bit time taking. So I am thinking to make a list and copy all the items in that list which will then be visible in the form’s field for selection.
What script should I write in the allowed values section to achieve this? Any ideas?

Hi @pctripathi ,

I suggest you create a custom object that stores all the values you want in the list. Then in the allowed values create a script/rule that queries the custom object.

Thanks,

1 Like

Hi @dylanfoggan
I can code your approach in java. Can you help me a little by giving me a templete for beanshell script in which I should include my code. Actually I am new to sailpoint and still learning.

Hi @pctripathi ,

To confirm, are you asking for the “Allowed Values” Rule template?
If so you can take a look at this document where it gives examples of all types of rules in IdentityIQ.

https://community.sailpoint.com/t5/Technical-White-Papers/Rules-in-IdentityIQ/ta-p/78176

Thanks,

Hi,

I have attached the sample code to returnt the list of service account. In the form field drop down, it will display all the valid service account.

You can take below as a sample code to update your values as a list in custom object.

   <entry key="Cars">
        <value>
          <Map>
            <entry key="Model">
              <value>
                <List>
                  <String>ABC</String>
	              <String>XYZ</String>
                </List>
              </value>
            </entry>
          </Map>
        </value>
    </entry>

Use below sample code as a references to fetch values from custom object

Custom custom = context.getObjectByName(Custom.class, "Replace-Custom-Object-Name");
Map map = custom.getAttributes().getMap().get("Cars");
1 Like

Hi @pctripathi ,

Do one thing, create a custom object and store all values in that. And use the custom object in field value rule of the attribute (you are suppose to creating) in the form.

Custom Object:

<?xml version='1.0' encoding='UTF-8'?> IT Sales Marketing Engineering

Code to get those values as list and return it:

    import sailpoint.object.*;
    import sailpoint.api.*;
    import java.util.*;
    
    Custom deptsCustom = context.getObjectByName(Custom.class, "BPK-Depts-List");
    List deptsList = deptsCustom.get("deptsList");
    
    return deptsList;

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.