Decision Table - Not getting expected value back in response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 09:28 AM
I am putting a business rule together that takes a set of values from the form after it is saved and applies checks several possible boolean fields if the conditions apply.
I am able to get the false value to return, but the true value comes back as undefined.
var current = new GlideRecord("sn_vdr_risk_asmt_vdr_tiering_assessment");
if (current.get("2fa55b5cc3314a10fefddcef0501318f")) {
try {
var inputs = {};
inputs['u_inferences'] = current; // Reference, Sys ID of the record
var dt = new sn_dt.DecisionTableAPI();
var response = dt.getDecisions('5f86416e93a94210561430747aba1073', inputs);
var result_elements = response.result_elements;
current.u_biometric_information = result_elements.u_biometric_information.getValue(); // True/False
current.u_commercial_information = result_elements.u_commercial_information.getValue(); // True/False
current.u_geolocation_information = result_elements.u_geolocation_information.getValue(); // True/False
current.u_identifiers = result_elements.u_identifiers.getValue(); // True/False
current.u_inferences = result_elements.u_inferences.getValue(); // True/False
current.u_internet_network_activity = result_elements.u_internet_network_activity.getValue(); // True/False
current.u_none = result_elements.u_none.getValue(); // True/False
current.u_sensory_data = result_elements.u_sensory_data.getValue(); // True/False
current.u_sensitive_personal_information = result_elements.u_sensitive_personal_information.getValue(); // True/False
current.u_protected_classification_characteristics = result_elements.u_protected_classification_characteristics.getValue(); // True/False
current.u_professional_employment_info = result_elements.u_professional_employment_info.getValue(); // True/False
current.u_other_personal_information = result_elements.u_other_personal_information.getValue(); // True/False
} catch (e) {
gs.log("Couldn't run this script Error: " + e);
}
gs.info(current.u_biometric_information);
gs.info(current.u_commercial_information);
gs.info(current.u_geolocation_information);
gs.info(current.u_identifiers);
gs.info(current.u_inferences);
gs.info(current.u_internet_network_activity);
gs.info(current.u_none);
gs.info(current.u_sensory_data);
gs.info(current.u_sensitive_personal_information);
gs.info(current.u_professional_employment_info);
gs.info(current.u_protected_classification_characteristics);
gs.info(current.u_other_personal_information);
}
I am running this currently as a background script against a record I would expect the u_commercial_information to be true, but it's getting undefined.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 01:27 PM
I did that, and that helped as well as the .getValue() the autogenerated portion of the script. If I understand the JSON correctly, result_elements is the name and then .element for each item. It appears in the JSON that the true value is not being carried over. The idea is that for each field on the form, if it has that specific value (the condition), then it sets the result for the affected field to true. Any idea why it wouldn't carry over the value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-23-2024 01:51 PM
I don't think it has to do with the value being true. Try changing the value of the 'Biometric information' output in the Decision Table to true and see if it's printed out.
Since it's only impacting a single output and from looking at the thread above, I am guessing the name of the output is incorrect.
Can you run the following code and see if the 'name' of the 'Commercial Information' output name is correct?
var dt = new sn_dt.DecisionTableAPI();
var response = dt.getDecisionTable("5f86416e93a94210561430747aba1073");
gs.info(JSON.stringify(response));
If unsure, paste the output here and I can look into it

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2024 07:20 AM
I figured out what was happening. The inputs were looking at the sys_id of the choice list used to evaluate against the table. I updated the inputs variable to get the Display Value. Once I did that, it was able to properly evaluate against the table and return the values I'm looking for.
inputs['u_customer_characteristics'] = current.getDisplayValue('u_cpii_customer_characteristics');
From there, it's just a matter of setting where the output sets the boolean to true if it ever encounters it as true.