No response is being received once Script Include is called in Catalog Client Script

Appu2
Tera Contributor

I have written this script include to filter the values from a table based on other field values selection:

var KPMG_nTAAPDetails = Class.create();
KPMG_nTAAPDetails.prototype = Object.extendsObject(AbstractAjaxProcessor, {
    retrieveDetails: function() {
        var targetTable = 'u_ntaap_mapping';
        var initialField = 'u_user_access_type';
        var otherFields = ['u_project_name''u_project_code''u_environment_team_name''u_environment_teams_code''u_role_name''u_role_code'];

        var initialGlideAggregate = new GlideAggregate(targetTable);
        initialGlideAggregate.addNotNullQuery(initialField);
        initialGlideAggregate.groupBy(initialField);

        var uniqueValuesMap = {};

        while (initialGlideAggregate.next()) {
            var initialValue = initialGlideAggregate.getValue(initialField);

            var uniqueValuesForOtherFields = {};
            for (var i = 0; i < otherFields.length; i++) {
                var otherField = otherFields[i];
                var otherFieldValues = [];

                var otherGlideRecord = new GlideRecord(targetTable);
                otherGlideRecord.addQuery(initialField, initialValue);
                otherGlideRecord.query();

                while (otherGlideRecord.next()) {
                    var otherValue = otherGlideRecord.getValue(otherField);
                    if (otherValue && otherFieldValues.indexOf(otherValue.toString()) === -1) {
                        otherFieldValues.push(otherValue.toString());
                    }
                }
                uniqueValuesForOtherFields[otherField] = otherFieldValues;

            }
            uniqueValuesMap[initialValue] = uniqueValuesForOtherFields;
            //uniqueValueMapping = JSON.stringify(uniqueValuesMap, null, 2);
        }
        
        return JSON.stringify(uniqueValuesMap, null2);
    },

    type: 'KPMG_nTAAPDetails'
});
 
Now I have to create a Catalog Client Script to parse the output received from Script Include into different catalog variables and they should be added as dropdowns. Can anyone help me with script? to call this script include and response should be returned from script include
4 REPLIES 4

Ankur Bawiskar
Tera Patron
Tera Patron

@Appu2 

you have script include ready.

did you not start the client script part? what did you start and where are you stuck?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Appu2
Tera Contributor

I need the client script code to call this script include and get the values as drop downs.

Appu2
Tera Contributor

Can anyone please provide me some inputs on my question?

Appu2
Tera Contributor

Any inputs?