To display a dot walked field of Glidelist field

Shilpa G
Tera Contributor

In the main table I have a field named "Applications" , which is a glide_list referencing another table. I want to display the "Information Classification" field from each referenced Application record in a report that is sourced from the main table.

2 REPLIES 2

Mark Manders
Mega Patron

You will need to create a database view for that. You can dotwalk to fields on a reference field and add them to the form, but you can't from a list, because there is an unlimited number of records that could be in there.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Samaksh Wani
Giga Sage
Giga Sage

Hello @Shilpa G 

Create a Scripted Report Source that returns records from the Application table along with Main Table references.

  1. Go to Report Sources > New.

  2. Choose Type = Scripted Source.

  3. In the script, loop through Main Table records, then for each, return each associated Application with its classification and main record info.

(function reportSourceScript() {
    var gr = new GlideRecord('x_main_table'); // replace with actual Main Table name
    gr.query();

    while (gr.next()) {
        var appIDs = gr.applications.toString().split(',');
        for (var i = 0; i < appIDs.length; i++) {
            var app = new GlideRecord('application'); // replace with actual Application table
            if (app.get(appIDs[i])) {
                var row = {};
                row.main_record_name = gr.name; 
                row.app_name = app.name;
                row.info_classification = app.information_classification;
                gs.print(JSON.stringify(row)); 
            }
        }
    }
})();

 

Pls mark my solution as accept and thumbs up if you find it helpful. It will help other users on community to find helpful response.

 

Regards,

Samaksh Wani