Manage Related Tables and Scripted Elements forms

  • Release version: Xanadu
  • Updated August 1, 2024
  • 1 minute to read
  • Manage the Related Tables and Scripted Elements components that are required to create a Microsoft PowerPoint template.

    Before you begin

    Role required: sn_ppt_export.ppt_admin

    Procedure

    1. Navigate to All > PowerPoint Management > PowerPoint Report Types.
    2. Select a parent table record, for example, Project report pm_project.
      OptionDescription
      To manage Related Tables You can add a custom remote table or a child from the parent table.
      1. In the Related Tables related list, select New.

        On the Related tables form, fill the fields. For a description of the field values, see Related Tables form.

      2. To add a custom remote table:
        1. Create a remote table.
        2. Select the required remote table from list.
        3. Select the Enable custom script option.
        4. In the Custom script box, write the code to establish a connection between the remote table and main table.
      3. To select a child table from the main table:
        1. Select a child table from list.
        2. Set the Parent relation column to the field that links the child table to the parent table.
      4. Select Submit.

      The selected table and its relation to the parent table is displayed in the Related tables section.

      To manage Scripted Elements
      1. In the Scripted Elements component, select New.
      2. On Scripted Elements form, fill the fields. For a description of the field values, see Scripted Elements form.
      3. Select Submit.
    3. To configure a Script component, specify the script logic to generate dynamic content in the template.

      Script components allow you to include calculated or dynamically generated content in your PowerPoint template. Use scripts when the built-in Field, Table, or Text component types do not meet your requirements.

      Example: To display a formatted project health status:

      (function() {
                        var gr = new GlideRecord('pm_project');
                        gr.get(current.getValue('sys_id'));
                        var health = gr.getValue('health');
                        if (health == 'green') return 'On Track';
                        else if (health == 'yellow') return 'At Risk';
                        else return 'Off Track';
                        })()
      Note:
      Verify the available scripting API and context variables with your ServiceNow administrator. Script components execute server-side and have access to the current record context.
    4. Select Update.