platform analytics dashboard pa indicator breakdowns
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Need Help: Breakdown Mapping for Integer Field (Category) on Case Table for CSAT Surveys
Hi everyone,
I'm working on setting up indicator breakdowns for "CSAT surveys sent", and I've run into a challenge with a specific field type.
My Goal:
I need to break down the total number of CSAT surveys sent (reported on the "Assessment Instance" table) by the "Category" field on the "Case" table.
The Setup & Problem:
1. "Indicator Source:" Based on the "Assessment Instance" table.
2. "Breakdown Source:" I created a breakdown source based on the Category field (dot-walked from Assessment Instance to Case).
3. Field Type Issue: The Category field on the `Case [sn_customerservice_case]` table is an Integer type. When I try to set up the Breakdown Mapping for the indicator, this integer field isn't available for direct selection. Other fields on the Case table (like Choice or Reference fields) are available without issues.
What I've Tried (and Failed At):
I attempted to use a Breakdown Script to map the integer value, but I'm getting an error when I try to use the `current` object to access the field value:
Error: `Error during JavaScript evaluation: Not all references of "current" are passed in by "arguments" script: function getCategoryValue() { ... }`
This usually suggests an issue with how the script context is being passed in Performance Analytics.
My Question:
Has anyone successfully created a breakdown on an Integer field that requires dot-walking in Performance Analytics? Is there a known workaround for mapping integer fields directly, or a correct way to write the breakdown script for this scenario using the `current` object in a breakdown mapping script?
Any guidance or ideas would be greatly appreciated!
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
an hour ago
Hi @PrachiK30643225 ,
Method 1: Add a new field to the Case table. Create a string or choice field on the Case [sn_customerservice_case] table to store the string value of the category. A choice field is ideal because it provides a finite, pre-defined list of values for the breakdown. Run a one-time script (a fix script) to populate the new field for all existing Case records. And Update the breakdown source and mapping w.r.t new field
Method 2: If creating new field is not possible, Use breakdown script
function getCategoryValue() { var category = ''; var caseGr = new GlideRecord('sn_customerservice_case'); if (caseGr.get(current.u_case)) { // Replace 'u_case' with the actual field on Assessment Instance that references the Case category = caseGr.category.toString(); } return category; }
Important: The current object in a PA script refers to a record from the indicator's Indicator Source. You must GlideRecord from the Assessment Instance (current) to the Case table to retrieve the Category field. The example assumes your Assessment Instance table has a reference field called u_case pointing to the Case table. Adjust this to match your actual field name.
And Update the breakdown mapping.
- Navigate to your automated breakdown.
- In the Breakdown Mappings related list, click New.
- Select your Assessment Instance indicator source table.
- In the Field dropdown, select -- New scripted --.
- In the Script field that appears, select the new script you created in the previous step.
If I could help you with your Query then, please hit the Thumb Icon and mark as Correct !!
Thanks, GP