Created Review form but receiving different data

Hi I have created a form with below fields

Code of above image

<Field displayName="Select" dynamic="true" name="Field_6" postBack="true" required="true" type="Application"/>
    <Field displayName="Roles" multi="true" name="Field_7" postBack="true" required="true" type="Bundle">
      <AllowedValuesDefinition>
        <Script>
          <Source>
            import sailpoint.tools.Util;
            import sailpoint.object.Bundle;
            import sailpoint.object.QueryOptions;
            import sailpoint.object.Filter;

            List roleList= new ArrayList();
            QueryOptions ops=new QueryOptions();
            ops.addFilter(Filter.eq("type","SAP"));
            Iterator it = context.search(Bundle.class, ops); 
            while ( (null != it) &amp;&amp; (it.hasNext()) ) { 
            Bundle record = (Bundle)it.next(); 
            roleList.add(record.getName()) ;
            }
            return roleList;
          </Source>
        </Script>
      </AllowedValuesDefinition>
    </Field>

After clicking the review button, other fields are coming as it is but these two fields are different as given below

Code for the above

<Field displayName="Select" name="Field_6" type="string">
      <Attributes>
        <Map>
          <entry key="readOnly" value="true"/>
        </Map>
      </Attributes>
      <Script>
        <Source>return Field_6;</Source>
      </Script>
    </Field>
    <Field displayName="Roles" name="Field_7" type="string">
      <Attributes>
        <Map>
          <entry key="readOnly" value="true"/>
        </Map>
      </Attributes>
      <Script>
        <Source>return Field_7;</Source>
      </Script>
    </Field>

Why is this happening?

@pctripathi

Your field actually internally holds the id of the type, if you are looking for name, please use below codes

<Field displayName="Select" name="Field_6" type="string">
      <Attributes>
        <Map>
          <entry key="readOnly" value="true"/>
        </Map>
      </Attributes>
      <Script>
        <Source>
		import sailpoint.object.Application;
		String appName=context.getObjectById(Application.class, Field_6.toString());
		return appName;
		
		</Source>
      </Script>
    </Field>
    <Field displayName="Roles" name="Field_7" type="string">
      <Attributes>
        <Map>
          <entry key="readOnly" value="true"/>
        </Map>
      </Attributes>
      <Script>
        <Source>
	    import sailpoint.object.Bundle;
		String roleName=context.getObjectById(Bundle.class, Field_7.toString());
		return roleName;
				
		</Source>
      </Script>
    </Field>
1 Like

Hi @pctripathi ,

Change the type in confirmation form.

  <Field displayName="Select" name="Field_6" type="Application">
      <Attributes>
        <Map>
          <entry key="readOnly" value="true"/>
        </Map>
      </Attributes>
      <Script>
        <Source>return Field_6;</Source>
      </Script>
    </Field>
    <Field displayName="Roles" name="Field_7" type="Bundle">
      <Attributes>
        <Map>
          <entry key="readOnly" value="true"/>
        </Map>
      </Attributes>
      <Script>
        <Source>return Field_7;</Source>
      </Script>
    </Field>
1 Like

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