Create a case data collector for a PaCE policy in Grants Management
Create a data collector within PaCE to use a set of data within a policy.
About this task
Data collectors collect input process data from within your organization or from a provided external data source to provide an output that can be used in the policy logic to make a decision. This will be used when creating a policy and referencing fields that must be calculated or cannot be dot walked from the case. You can define and manage data collectors by creating, editing, updating, and activating them to your policy builder.
Before you begin
Role required: admin
Procedure
Navigate to All > Workspaces > CSM Configurable Workspace.
From the CSM Configurable Workspace sidebar, navigate to the Policy Home.
In the Variable Definition list, select the Data Collectors list.
Select New to create a data collector.
Enter the name of the data collector and a description, then select Save.
Select Save.
Select the Versions (1) related list, and select Draft-V0.1.
Select the Build tab.
Under Define Variables, select Add to add an input variable.
On the form, fill in the fields with the following information.
Field Value Label Label of the input variable. Name The name of the output variable used within the data collector script. Type The input variable data type. This can be reference, string, int. Description The description of what this input variable is used for. Table Table referenced for the input variable Under Define Variables, select the Output tab, then select Add to add an output variable.
On the form, fill in the fields with the following information.
Field Value Label The label of the output variable Name The name of the output variable used within the data collector script Type The data type of the output variable. This can be reference, integer, string/ Description This is the description of the output variable. Under Data collector script, enter the following code snippet:
(function(inputs, outputs) { var totalGrossIncome = 0; var incomeDetailsGr = new GlideRecord("sn_svc_appl_info_income_details"); incomeDetailsGr.addQuery("case_record", inputs.case.sys_id); incomeDetailsGr.query(); //Loop through each income details record for the case while (incomeDetailsGr.next()) { var tempPaymentFrequency = incomeDetailsGr.getValue("payment_frequency"); if(tempPaymentFrequency == "every_2_weeks") totalGrossIncome += incomeDetailsGr.amount * 2; else if(tempPaymentFrequency == "weekly") totalGrossIncome += incomeDetailsGr.amount * 4; else if(tempPaymentFrequency == "once_a_year") totalGrossIncome += incomeDetailsGr.amount/12; else totalGrossIncome += incomeDetailsGr.amount; } outputs.total_gross_income = totalGrossIncome; })(inputs, outputs);Select Save, then select Publish.
Select the checkbox next to Activate this data collector and then select Publish.
Result
A data collector for a policy version is now created.
What to do next
Create an eligibility policy using PaCE
Parent Topic:Configure Eligibility Rules Engine Policies in Grants Management