Issue with "reviewRequired" on Form Field

Which IIQ version are you inquiring about?

8.3p3

Share all details about your problem, including any error messages you may have received.

Background - I have an Update Provisioning Policy on an Active Directory application. Under a specific condition, I need it to pop up with a field that the requester needs to fill out.

Scenario - If a user requests entitlement “A” , I need the form to pop up with a field for the requester to fill out. If that entitlement is NOT selected, no form needs to pop up.

Problem - If the field in question has “reviewRequired = true”, the form pops up no matter if entitlement “A” is selected or not.

And if “reviewRequired = false”, the form never pops up. Even if entitlement “A” is selected.

Is there a way to dynamically set the “reviewRequired” attribute on a field?

Or is there some other way to make this work?

hi @adam_carter

  • The reviewRequired attribute is static — if set to true, the field always appears, regardless of conditions.
  • To dynamically show/hide a field, you should use the hidden or readOnly attributes, which can be controlled via a rule or script.

You can’t dynamically set reviewRequired, as it’s evaluated statically.

Instead, use a hidden rule on the form field to check if entitlement “A” is selected. This way, the field only appears when needed.

Example logic:

import sailpoint.object.IdentityRequest;
import sailpoint.object.IdentityRequestItem;

boolean showField = false;

if (request != null) {
    List items = request.getItems();
    for (IdentityRequestItem item : items) {
        if ("entitlementA".equals(item.getValue())) {
            showField = true;
            break;
        }
    }
}
1 Like

Thank you for the reply.

I am getting an error when using your code stating that “request” is an undefined variable. How do I make that available to the form?

I think this was just an example.

To see what was requested you need to look inside the plan.

Hi @adam_carter ,

Here is the sample code for hiding fields in the form based on the selected values, you can modify according to your requirements.

 <Field displayName="Entitement" name="entitlement" postBack="true" type="string">
            <AllowedValuesDefinition>
              <Value>
                <List>
                  <String>EntitlementA</String>
                  <String>EntitlementB</String>
                </List>
              </Value>
            </AllowedValuesDefinition>
          </Field>
          <Field displayName="Optional Field" name="optionalField" type="string">
            <Attributes>
              <Map>
                <entry key="hidden">
                  <value>
                    <Script>
                      <Source>import sailpoint.object.Field;
                        import sailpoint.object.Form;

                        boolean hide = true;

                        Field entitlementField = form.getField("entitlement");

                        mylog.error("entitlementField : " + entitlementField);

                        if(entitlementField!=null){

                        String value = (String) entitlementField.getValue();

                        if(value!=null &amp;&amp; value.equalsIgnoreCase("EntitlementA") ){

                        hide = false;
                        
                        }

                        }

                        return  hide;
                      </Source>
                    </Script>
                  </value>
                </entry>
              </Map>
            </Attributes>
          </Field>
        </Section>

Shaik, now I am getting that same error for “args”.

I have the fields hidden. In the example where they select any other entitlement, ones that should NOT trigger the form, the form is still popping up but there is nothing on it. It is blank. So the fields are hidden, but it is still popping up the form.

Hi @adam_carter ,

You need to customize in the “identity Request Initialize” subporcess in Initialize step in LCM Provisoning Workflow.
Please update your code according to the below files


Customize Identity_Request_Initialize_Subprocess.xml (16.5 KB)
Identity Request Example Rule.txt (2.8 KB)

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