How to find the "Template" page /UI in Change workspace ?

Virendra K
Kilo Sage

Hi All,

 

Please refer below snap shot. I want to find the "Template" page/ UI option (snap 1) ? where I need to apply a filter condition to field while creating a new template(snap 2)? I am new to the UI builder and workspace so unable find it.

How I could go and see below Template option in UI builder ? 

VirendraK_0-1745940372313.png

 

VirendraK_1-1745940479109.png

 

Regards,

Virendra

8 REPLIES 8

@Virendra K 

then did you check how it's currently showing 1 value based on some condition

The script which does this is what you need to find and tweak

Did you check in native/classic view any reference qualifier etc applied?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar 

 

It will come later, but my challenge is, I don't know how to go to Toggle Template bar interface and see how these fields are configured.

Seems there is UI page working this , but I am unable to understand after going through the code.


Let me paste the code here,

VirendraK_0-1746086347143.png

 

 

HTML-

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:messages>
The following mandatory fields are not filled in
Template name
</g:messages>
<g2:evaluate var="jvar_config_id"  jelly="true">
    //Get TeamSpace configuration id for current project table
    var config_id = SNC.PPMConfig.getConfigId("${sysparm_table}");
    config_id;
</g2:evaluate>
<g:ui_form>
    <input type="hidden" name="template_action" id="template_action" value="${sysparm_template_action}"/>
    <input type="hidden" name="project_id" id="project_id" value="${sysparm_project_id}"/>
    <input type="hidden" name="template_id" id="template_id" value="${sysparm_template_id}"/>
    <input type="hidden" name="config_id" id="config_id" value="$[jvar_config_id]"/>
    <input type="hidden" name="sysparm_table" id="sysparm_table" value="${sysparm_table}"/>
    <div id="load_mask_container" style="display: none;">
            <span class="icon icon-loading"></span>
    </div>
    <div id="ui_page_content" class="create_template">
        <g:create_project_template/>
    </div>  
</g:ui_form>
<style>
    #load_mask_container {
        display: -webkit-box;
        display: -moz-box;
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        height: 100%;
        width: 100%;
        background-color: #ffffff;
        position: absolute;
        top: 0;
        left: 0;
        opacity: 0.80;
        z-index: 1000;
        align-items: center;
        -ms-flex-align: center;
        justify-content: center;
        -ms-flex-pack: center;
    }
</style>
</j:jelly>
 
======================================================================
Client script:
function onCancel() {
    GlideDialogWindow.get().destroy();
    return false;
}

function actionOK() {
    var form = document.forms['form.' + '${sys_id}'];

    //validate start_date and template_id
    var template_id = form["template_name"].value;
    if (!template_id) {
        theText = new GwtMessage().getMessage('The following mandatory fields are not filled in: {0}', getMessage("Template name"));
        alert(theText);
        return false;
    }
   
    addInput(form, "HIDDEN", "sys_action", form["template_action"].value);
    showLoadMask();
    return true;
}

function showLoadMask() {
    var loadMask = document.getElementById('load_mask_container');
    loadMask.style.display = 'flex';
}
===========================================================================
Processing script-
var template = null;
var templateTable = SNC.PPMConfig.getTemplateTable(sysparm_table);
var projectTable = SNC.PPMConfig.getProjectTable(sysparm_table);

if (sys_action  == "copy_template" && template_id) {
    var gr = new GlideRecord(templateTable);
    if (gr.get(template_id))
        template = GlideProjectTemplate.copyTemplate(gr, template_name, template_desc);
} else if (sys_action  == "create_template" && project_id) {
    var gr = new GlideRecord(projectTable);
    if (gr.get(project_id))
        template = GlideProjectTemplate.createTemplate(gr, template_name, template_desc);
}
if (template){
    response.sendRedirect(templateTable + ".do?sys_id=" + template.getUniqueValue());
}
} else {
    /* Removed log in PROD */
    response.sendRedirect(projectTable + "_list.do");
}


   

@Virendra K 

I will recommend not touching the OOTB ui page.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

Hi @Ankur Bawiskar 

I am not going to edit it.

While creating new template in Change workspace, I want to remove/apply the condition for the below field to get all the values once we click on magnifier. Currently its showing only one values from Customer experience table (snap2) and the ask is to show all relevant field.

 

I am not able to understand how I could set this filter /condition ?

 

VirendraK_0-1746087870893.png

VirendraK_1-1746087974483.png