Provisioning Form not showing the drop down value correctly

Hi

I am trying to add a form to with a select option in a dropdown list

In the form its just showing second value from the list in custom attribute

I have added the form as well as the custom object below

Looking to get all the list elements in the dropdown

Thanks

        import java.util.ArrayList;
        import java.util.List;
        import sailpoint.object.Custom;
                    
        List options = new ArrayList();
        Custom customObject = context.getObjectByName(Custom.class, "Custom Area");
        if (customObject != null) {
			Map mapAttribute = customObject.getAttributes();
			options = new ArrayList(mapAttribute.values());
        }
        return options;
      </Source>
    </Script>
  </AllowedValuesDefinition>
</Field>

This is the custom object

ALPHA OPI B C GAMA D

Hi @guptaMani , Welcome to sailpoint developer community.

Please go through this → 8.4 IdentityIQ Forms Guide - Compass

In Allowed Values definition, we should pass list of values.

Could you please confirm your logic returns list of String or share Custom object by hiding sensitive information along with Form field details if possible.

Hi @mandarsane ,

Here’s the custom object and yes AllowedValuesDefinition returns list of strings

  <Attributes>
    <Map>
      <entry key="area">
        <value>
          <List>
            <String>ALPHA</String>
            <String>OPI</String>
            <String>B</String>
            <String>C</String>
            <String>GAMA</String>
            <String>D</String>
          </List>
        </value>
      </entry>
    </Map>
  </Attributes>
</Custom> ```

Your code is calling mapAttribute.values()— that returns the values of the top-level attribute map, which in this case is a single entry: the List object stored under the key area.

So options ends up as: [[ALPHA, OPI, B, C, GAMA, D]] — a list containing one List, not a flat list of strings. The dropdown then renders only the second element of that outer list, which happens to be the inner List object rendered as its first visible string OPI.

use the below code and try it

import java.util.ArrayList;
import java.util.List;
import sailpoint.object.Custom;

List options = new ArrayList();
Custom customObject = context.getObjectByName(Custom.class, "Custom Area");
if (customObject != null) {
    List areaList = (List) customObject.get("area");
    if (areaList != null) {
        options = areaList;
    }
}
return options;

try it and let me know if it works

Thank you, the above code works

@naveenkumar3

This form is not showing up when I submit the request for myself

I have added reviewrequested as true too but it straight goes to request submitted instead of launching the form

Do I need to add some changes

can you share the xml please?? If reviewrequired is set to true it should show you the form.

I got the form popped up by cleaning the identity