Decision Table - Not getting expected value back in response.

Aaron Duncan
Mega Sage

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.

 

AaronDuncan_0-1713889670709.png

 

12 REPLIES 12

Jon23
Mega Sage

Hi @Aaron Duncan ,

Does field name [u_commercial_information], exist?

 

What do you get if you add line?

gs.info(result_elements.u_commercial_information.getValue());

 

I added the line, and I get undefined. Also, I did validate the field does exist on the form.

AaronDuncan_0-1713896266015.png

 

Murthy Ch
Giga Sage

Hi @Jon23 

Can you share the screenshot of that particular condition in your DT?
Also, Please double check the filed-name as suggested by @Jon23 

Thanks,
Murthy

Here is the input and the initial condition with the results.

 

AaronDuncan_1-1713896307801.png

Here is an example of a condition that should trigger the field to be set to true. The 3rd Column is the value for the Commercial Information field.

AaronDuncan_2-1713896330497.png