How can I use custom form selected dynamic value in my report ReportColumnConfig field

I have created one custom form in report and I want use form value which are selecting from drop down field into ReportColumnConfig field in report for manipulating data based on form selected value. I have already added the reference of custom form.

Hi @amanKsingh
Can you please share the custom report and the form also what error are you facing ?

Hi @vinnysail,
I want to use application_name what I have selected from custom form I want to use that form value here.

 <ReportColumnConfig field="application_name" header="Application" property="iri.value" sortable="true" width="110">
                <RenderScript>
                  <Source>

// **********************************
                 </Source>
            </RenderScript>
      </ReportColumnConfig>

report:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition  executor="sailpoint.reporting.LiveReportExecutor"  name="EntitlementRole_History_custom_report1" progressMode="Percentage" resultAction="Rename" subType="Lifecycle Manager Reports" template="true" type="LiveReport">
  <Attributes>
    <Map>
      <entry key="auditEventTypes">
        <value>
          <List>
            <String>AccessRequest</String>
            <String>EntitlementsRequest</String>
            <String>RolesRequest</String>
          </List>
        </value>
      </entry>
      <entry key="report">
        <value>
          <LiveReport title="Access Request Status Report">
            <DataSource type="Hql">
              <Query>

                from IdentityRequestItem iri,IdentityRequest ir where iri.identityRequest = ir.id and iri.name='assignedRoles' and iri.approvalState='Finished' and iri.operation != 'Set'

              </Query>
              <QueryParameters>
                <Parameter argument="applications"/>
                <Parameter argument="targetIdentities"/>
                <Parameter argument="requestors"/>
                <Parameter argument="entitlements"/>
                <Parameter argument="status"/>
                <Parameter argument="requestedDateStart"/>
                <Parameter argument="requestedDateEnd"/>
                <Parameter argument="completionDateStart"/>
                <Parameter argument="completionDateEnd"/>
              </QueryParameters>
              <QueryScript>
                <Source>
                  // System.out.println("1");
                  import java.util.*;

                  List application = args.get("applications");

                  List target = args.get("targetIdentities");

                  List requester = args.get("requestors");

                  List entitlement = args.get("entitlements");

                  String status = args.get("status");

                  Date reqStartDate = args.get("requestedDateStart");

                  Date reqEndDate = args.get("requestedDateEnd");

                  Date compStartDate = args.get("completionDateStart");

                  Date compEndDate = args.get("completionDateEnd");



                  if(application != null &amp;&amp; !application.isEmpty()){

                  query = query + " and app.id in (:applications)";


                  }

                  if(target !=null &amp;&amp; !target.isEmpty()){

                  query = query + " and ir.targetId in (:targetIdentities)";

                  }

                  if(requester !=null &amp;&amp; !requester.isEmpty()){

                  query = query + " and ir.requesterId in (:requestors)";

                  }

                  if(entitlement !=null &amp;&amp; !entitlement.isEmpty()){

                  query = query + " and iri.value in (:entitlements)";

                  }

                  if(status !=null &amp;&amp; !status.isEmpty()){

                  query = query + " and iri.approvalState in (:status)";

                  }

                  if(reqStartDate !=null){

                  query = query + " and ir.created >= :requestedDateStart";

                  }

                  if(reqEndDate !=null){

                  query = query + " and ir.created &lt;= :requestedDateEnd";

                  }

                  if(compStartDate !=null){

                  query = query + " and ir.endDate >= :completionDateStart";

                  }

                  if(compEndDate !=null){

                  query = query + " and ir.endDate &lt;= :completionDateEnd";

                  }

                  return query;

                </Source>
              </QueryScript>
            </DataSource>
            <ReportForm>
              <Reference class="sailpoint.object.Form" id="0aaa252490951fd781909701350a6c14" name="Access Request Status Form - roleApplication_name"/>
            </ReportForm>
            <Columns>
              <ReportColumnConfig field="requestId" header="Access Request ID" property="ir.name" sortable="true" width="110"/>
              <ReportColumnConfig field="requester" header="Requester" property="ir.requesterDisplayName" sortable="true" width="110">
                <RenderScript>
                  <Source>
                   
                    //  System.out.println("2.4");

                  </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="requestee" header="Requested For" property="ir.targetDisplayName" sortable="true" width="110">
                <RenderScript>
                  <Source>
                  //  System.out.println("requestee");
                   

                  </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="requestDate" header="Request Date" property="ir.created" sortable="true" width="110"/>
              <ReportColumnConfig field="operation" header="Operation" property="iri.operation" sortable="true" width="110"/>
              <ReportColumnConfig field="application_name" header="Application" property="iri.value" sortable="true" width="110">
                <RenderScript>
                  <Source>
                *******************************************
                //********************************************  
              // I want to use what I have selected from form that application name.  
                    import java.util.*;
                    import sailpoint.object.*;
                    import sailpoint.api.SailPointContext;
                    import sailpoint.tools.GeneralException;
                    import sailpoint.object.QueryOptions;
                    import sailpoint.object.Filter;
                    
                   
                    import sailpoint.reporting.*;
                  
                    
                    // System.out.println("application;;;;;;;;;;;;;;;;;;;;;;;"+value);
                      QueryOptions qo = new QueryOptions();
              qo.addFilter(Filter.eq("displayName", value));
                    
                 
                  List roleList= context.getObjects(Bundle.class,qo);  
             //    Set&lt;String> application_name_set = new HashSet();
                  
              
                  for(Bundle b:roleList){
                      String s=(String)b.getAttribute("application_name");
                     return s;
                  
                  }
             

                  </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="entitlementValue" header="Roles" property="iri.value" sortable="true" width="110"/>
              <ReportColumnConfig field="status" header="Status" property="iri.approvalState" sortable="true" width="110"/>
              <ReportColumnConfig field="completionDate" header="Date of approval" property="ir.endDate" sortable="true" width="110"/>
              <ReportColumnConfig field="employeeType" header="Employee Type" property="ir.targetDisplayName" sortable="true" width="110">
                <RenderScript>
                  <Source>
                    //  System.out.println("2");
                   
                  </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="costCenter" header="Cost Center" property="ir.targetDisplayName" sortable="true" width="110">
                <RenderScript>
                  <Source>
                    //         System.out.println("2");
                   

                  </Source>
                </RenderScript>
              </ReportColumnConfig>
            </Columns>
          </LiveReport>
        </value>
      </entry>
      <entry key="reportTitle" value="rept_lcm_entitlement_request_status_title"/>
    </Map>
  </Attributes>
  <Description>Displays information about access requests from LCM in detailed format.</Description>
  <Signature>
    <Inputs>
      <Argument multi="true" name="application_name" type="Application">
        <Description>rept_input_app_activity_report_action</Description>
      </Argument>
      <Argument multi="true" name="approvers" type="Identity">
        <Description>rept_input_lcm_request_status_report_approver</Description>
      </Argument>
      <Argument multi="true" name="requestors" type="Identity">
        <Description>rept_input_lcm_request_status_report_requester</Description>
      </Argument>
      <Argument multi="true" name="entitlements" type="sailpoint.object.IdentityItem">
        <Description>rept_input_lcm_request_status_report_entitlements</Description>
      </Argument>
      <Argument multi="true" name="targetIdentities" type="Identity">
        <Description>rept_input_lcm_request_status_report_target_identity</Description>
      </Argument>
      <Argument name="status" type="string">
        <Description>rept_input_lcm_request_status_report_status</Description>
      </Argument>
      <Argument name="requestDateRange" type="daterange">
        <Description>rept_input_lcm_request_status_report_status</Description>
      </Argument>
      <Argument name="completionDateRange" type="daterange">
        <Description>rept_input_lcm_request_status_report_status</Description>
      </Argument>
    </Inputs>
  </Signature>
</TaskDefinition>

FORM:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Form PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Form  name="Access Request Status Form - roleApplication_name" type="Report">
  <Section columns="2" label="rept_lcm_entitlement_request_parameters" name="customProperties">
    <Field columnSpan="1" displayName="application_name" helpKey="rept_input_app_activity_report_action" multi="true" name="application_name" type="string" value="ref:action">
      <AllowedValuesDefinition>
        <Script>
          <Source>
import sailpoint.object.Filter;
import sailpoint.object.Identity;
import sailpoint.object.QueryOptions;
import java.util.*;
import sailpoint.object.Bundle;
                  
                  System.out.println("form100-----------------");
                  
              QueryOptions qo = new QueryOptions();
              qo.addFilter(Filter.eq("type", "business"));
                 
                  List roleList= context.getObjects(Bundle.class,qo);  
                 Set&lt;String> application_name_set = new HashSet();
                  
                  for(Bundle b:roleList){
                      String s=(String)b.getAttribute("application_name");
                      application_name_set.add(s);
                   // System.out.println("application_name"+ application_name);
                  
                  }
                 

                 // Filter filter = Filter.ignoreCase(Filter.eq("manager.name", mgrName));
//field.setFilterString(application_name);
                  
                  
 return application_name_set;
</Source>
        </Script>
      </AllowedValuesDefinition>
    </Field>
  </Section>
</Form>

Hi @amanKsingh,

can you try this?

Map formValues = form.getFieldValues();
if (   formValues != null &amp;&amp; formValues.containsKey("application") && formValues.get("application") != null){    
      String appid = formValues.get("application").get(0);
      Application application = context.getObjectById(Application.class,appid);
}

arreglate for your necessity

getting error:
Exception encountered while executing Report. Exception: Typed variable declaration : Attempt to resolve method: getFieldValues() on undefined variable or class name

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