Conditional process flow formatter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2017 11:43 PM
Hi All,
I needed a help in configuring the process flow formatter based on the type of the change request. I need to have different process flow to be displayed for different types. I have tried using https://share.servicenow.com/app.do#/detailV2/b2e4d80e2b5b75004a1e976be8da152c/overview posted by Drew West on Share portal, however, it didn't work. I am using the Helsinki version. Also, I am pretty new to UI formatting. Seek your help on step-by-step process for this configuration.
Thanks in advance,
Anu

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-13-2017 02:05 AM
Macro code below
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<tr>
<td>
<link rel="stylesheet" type="text/css" href="926a0c4ea4537100aca2ff48961114c3.cssdbx" />
<ol class="process-breadcrumb_hfhs process-breadcrumb_hfhs-border">
<g2:evaluate var="jvar_elements" jelly="true" object="true">
var afterCurrent = false;
var show = [];
var gr = new GlideRecord("sys_process_flow");
gr.addQuery("table", current.sys_class_name);
gr.orderBy("order");
gr.query();
while(gr.next()){
//Check to see if the record should be displayed. If so add element to array.
//Array info
// show[] -> Each element is a flow formatter record to display
// show[].label -> Label for the flow formatter element to display.
// show[].state -> used to indicate the state of the flow formatter element.
// Possible values: past, current, future
// show[].style -> used to store the class of the of the flow formatter element.
// Possible values: disabled, completed disabled, active
if(GlideFilter.checkRecord(current, gr.u_view_condition)){
var item = new Object();
item.label = gr.getValue("label");
//Check if this is the current flow that should be green/selected.
if(GlideFilter.checkRecord(current, gr.condition)){
item.state = "current";
item.style = "active";
afterCurrent = true;
} else {
if(afterCurrent){
item.state = "future";
item.style = "disabled";
} else {
item.state = "past";
item.style = "completed disabled";
}
}
show.push(item);
}
}
show;
</g2:evaluate>
<j2:forEach items="$[jvar_elements]" var="jvar_el">
<g2:evaluate jelly="true">
var label = jelly.jvar_el.label;
var state = jelly.jvar_el.state;
var style = jelly.jvar_el.style;
</g2:evaluate>
<li class="$[style]" data-state="$[state]"><a>$[label]</a></li>
</j2:forEach>
</ol>
</td>
</tr>
</j:jelly>
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-22-2017 09:29 AM