Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Change progress bar

Johnny Matthews
Mega Contributor

I'm trying to create a progress bar on a change form which showed the percentage of change tasks which are closed against a change. Does anyone achieved this just yet?

Thanks!

1 ACCEPTED SOLUTION

-Andrew-
Kilo Sage

Hi there,

You could try a UI Macro which should calculate this for you.

You would need to create a new field to capture the actual % through a business rule but convert this to a progressbar using the macro 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">
	 <j:set var="jvar_n"/>
<g2:evaluate var="jvar_user" object="true">
        var value = current.u_percentage_complete;

        gs.info('Value is: ' + value);
        value;
    </g2:evaluate>


	<div class="progress" style="width: 323px;position: relative;left: 37%;">
 <div id="${jvar_n}" class="progress-bar" role="progressbar" style="width:$[jvar_user]%;" aria-valuemin="0" aria-valuenow="50" aria-valuemax="100">
       <span class="sr-only">50%</span>
   </div>
</div>
	<a>${jvar_source.getValue('u_percentage_complete')}</a>
	
	
</j:jelly>

View solution in original post

1 REPLY 1

-Andrew-
Kilo Sage

Hi there,

You could try a UI Macro which should calculate this for you.

You would need to create a new field to capture the actual % through a business rule but convert this to a progressbar using the macro 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">
	 <j:set var="jvar_n"/>
<g2:evaluate var="jvar_user" object="true">
        var value = current.u_percentage_complete;

        gs.info('Value is: ' + value);
        value;
    </g2:evaluate>


	<div class="progress" style="width: 323px;position: relative;left: 37%;">
 <div id="${jvar_n}" class="progress-bar" role="progressbar" style="width:$[jvar_user]%;" aria-valuemin="0" aria-valuenow="50" aria-valuemax="100">
       <span class="sr-only">50%</span>
   </div>
</div>
	<a>${jvar_source.getValue('u_percentage_complete')}</a>
	
	
</j:jelly>