guptaMani
(Manisha Gupta)
June 18, 2026, 8:16pm
1
Version 8.4 p4
Hi
I am trying to build a provisioning form which has a listbox as field in it
This is using AllowedValuesDefinition and I am adding a script in it
I am trying to access application object inside the script
What is the best way to get this object in the provisioning form ?
Can I use form.getField(“application”).getValue() ?
Thanks
Hi @guptaMani - can you elaborate more on your use case?
Is this an application provisioning form like a create policy?
What value are you wanting to return, application name?
Since it is a list, what else are you needing in it?
Vinodcsod
(MuniVinodKumar Kummari)
June 19, 2026, 3:37am
3
Hi @guptaMani ,
You can add an applicationName field, and using value setting, you can set the application name and get that field form.getFiled(“applicationName”); or try direct field variable applicationName might work.
or
you can create a custom object and add list of appllication and using a rule, you can return those applications for allowedvaluesDefination.
sukarande
(Sumit Ukarande)
June 19, 2026, 4:48am
4
@guptaMani
Using form.getField(“application”).getValue() will only work if you explicitly have a field named “application” in your form that holds the application’s name as its value.
neel193
(Neelmadhav Panda)
June 19, 2026, 7:16am
5
@guptaMani Do you want to show all the application names available in your environment in the dropdown of your listbox field? If so, set the type to Application and it’ll show all the apps name in the dropdown. You can access field using the field name directly in your allowed rule.
guptaMani
(Manisha Gupta)
June 19, 2026, 5:00pm
6
@ryan_toornburg , Its a create provisioning form
I am pulling the values from a custom object which has a key as app name and value as a list of strings in a map
I will be matching the appname with key and return the values in that map
guptaMani
(Manisha Gupta)
June 19, 2026, 5:01pm
7
@sukarande , Can you please elaborate on that or give me an example.
Its a create provisioning form
I am pulling the values from a custom object which has a key as app name and value as a list of strings in a map
I will be matching the appname with key and return the values in that map
guptaMani
(Manisha Gupta)
June 19, 2026, 5:03pm
8
@neel193 Its a create provisioning form
I am pulling the values from a custom object which has a key as app name and value as a list of strings in a map
I will be matching the appname with key and return the values in that map
guptaMani
(Manisha Gupta)
June 19, 2026, 5:03pm
9
@Vinodcsod , Its a create provisioning form
I am pulling the values from a custom object which has a key as app name and value as a list of strings in a map
I will be matching the appname with key and return the values in that map
neel193
(Neelmadhav Panda)
June 19, 2026, 6:29pm
10
Please share your custom object, form and rule that you currently have. Will review and let you know how to get this.
guptaMani
(Manisha Gupta)
June 19, 2026, 8:20pm
11
Custom object
<?xml version='1.0' encoding='UTF-8'?>
sample
file
Unused
sample2
file2
Unused2
Form
import java.util.ArrayList;
import java.util.List;
import sailpoint.object.Custom;
import sailpoint.object.Application;
String appName = "";
if(form !=null @and null != form.getField("application")){
String appName = (String) form.getField("application").getValue();
}
Custom customObject = context.getObjectByName(Custom.class, "Custom ABC");
if (customObject != null @and form!= null) {
Map map = customObject.getAttributes();
List list = (List) map.get(appName);
return list;
}
return new ArrayList();
</Source>
</Script>
</AllowedValuesDefinition>
</Field>
guptaMani
(Manisha Gupta)
June 19, 2026, 8:21pm
12
<Custom name="Custom ABC">
<Attributes>
<Map>
<entry key="App 1">
<value>
<List>
<String>sample</String>
<String>file</String>
<String>Unused</String>
</List>
</value>
</entry>
<entry key="App 2">
<value>
<List>
<String>sample2</String>
<String>file2</String>
<String>Unused2</String>
</List>
</value>
</entry>
</Map>
</Attributes>
</Custom>
```
There is no rule
neel193
(Neelmadhav Panda)
June 20, 2026, 9:03am
13
Thanks. Let me add to my sandbox and get back.
Chathuryas
(Chathurya Simhadri)
June 21, 2026, 6:53am
14
Hi @guptaMani ,
Can you try adding the following code to your form to get the values from Custom object based on the selected application.
<Field displayName="Application" name="appId" postBack="true" required="true" type="Application"/>
<Field displayName="Custom Field" name="customField" postBack="true" type="string">
<AllowedValuesDefinition>
<Script>
<Source>
import sailpoint.object.Custom;
import sailpoint.tools.Util;
import sailpoint.object.Application;
import org.apache.log4j.Logger;
Logger mylog = Logger.getLogger("com.example.customLogs");
String appName = null;
mylog.error("Application ID : " + appId);
if(appId!=void && Util.isNotNullOrEmpty(appId)){
Application application = context.getObjectById(Application.class,appId);
if(application!=null && Util.isNotNullOrEmpty(application.getName())){
appName = application.getName();
mylog.error("App Name : " + appName);
}
}
mylog.error("Application Name : " + appName);
if(appName!=null){
Custom custom = context.getObjectByName(Custom.class,"Custom ABC");
if(custom!=null){
List list = custom.getList(appName);
if(list!=null && !list.isEmpty()){
return list;
}
}
}
</Source>
</Script>
</AllowedValuesDefinition>
</Field>
Let me know if you are facing any issues.
guptaMani
(Manisha Gupta)
June 22, 2026, 4:09pm
15
The code works but its prompting the user to enter the application name
What if I don’t want the user to enter the application but the form should read it from the application its currently attached to. (Since its application provisioning form)
If I remove required=“true”, will it still show the field and need input from user ?
Thanks
neel193
(Neelmadhav Panda)
June 22, 2026, 6:14pm
16
@guptaMani So, IIQ is presenting the provisioning policies as Identity Update workitem form, not as provisioning policy and there is object available which can directly reference to the application.
One thing you can try is you can have separate allowed value rule for each app+provisioning policy combo. in the rule you can hard code the application name and show the value in the dropdown after reading from custom object:
String appName = "TRAKK";
Custom customObj = context.getObjectByName(Custom.class,"Custom ABC");
if(customObj!=null){
List entryList = customObj.getList(appName);
if(entryList!=null && !entryList.isEmpty()){
return entryList;
}
return new ArrayList();
And if you remove required=true, then if field doesn’t have any value set then only it’ll prompt user to enter the value.
guptaMani
(Manisha Gupta)
June 22, 2026, 7:06pm
17
I wanted to make the form more generic to be used for multiple applications
Also, for comments, when I remove the required=“true” in the field, it doesn’t show the field itself. Is this expected ?
This is how the field looks like. I wanted to make comments optional
<Field displayName="Add comments" name="Comment" required="true" type="string"/>
Chathuryas
(Chathurya Simhadri)
June 23, 2026, 6:04am
18
Hi @guptaMani ,
Can you try adding the following code to your Provisioning Form instead of the above code to get dynamic allowed values based on the application.
<Field displayName="Custom Field" dynamic="true" name="customField" postBack="true" reviewRequired="true" type="string">
<AllowedValuesDefinition>
<Script>
<Source>
import org.apache.log4j.Logger;
import java.util.List;
import java.util.ArrayList;
import sailpoint.object.Custom;
String appName=null;
if(field!=null){
appName = field.getApplication();
if(appName!=null){
Custom custom = context.getObjectByName(Custom.class,"Custom ABC");
if(custom!=null){
List list = custom.getList(appName);
if(list!=null && !list.isEmpty()){
return list;
}
}
}
}
</Source>
</Script>
</AllowedValuesDefinition>
</Field>
And if you want to display ‘Add Comments’ to user, then you need to set reviewRequired=“true” and to make comments optional set required=“false”
RAKRHEEM
(Rakesh Bhati)
June 23, 2026, 6:05am
19
Thanks for sharing @Chathuryas
neel193
(Neelmadhav Panda)
June 23, 2026, 6:15am
20
@guptaMani field.getApplication returns the app name, form is associated with. @Chathuryas thanks for sharing.