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.

Want to calculate percentage for users added

Ash41
Kilo Sage

Hi, 

 

I have 2 fields, "Max Users count" field with integer type and "MAX user Volume %" field with string. These fields are on some x table, same table is related to sys_user table. 

 

If any update in "Max Users count" field

for example: 100

then field "MAX user Volume %" should update as 100%, 

 

I want to calculate Percentage on "MAX user Volume %" based on the value in "Max Users count" field. Please help

1 ACCEPTED SOLUTION

created new field and calculated % of field, issue resolved

View solution in original post

4 REPLIES 4

Hemanth M1
Giga Sage
Giga Sage

Hi @Ash41 ,

 

You just want add % to the Max User count and update on to the MAX user Volume field??

 

looking at your example it just adds % if so , just configure a BR/flow when Max User count changes , add same value with % 

if not whats the Percentage canculation logic??? 

need more info here

 

 

Accept and hit Helpful if it helps.

Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025

Bert_c1
Kilo Patron

Here's script logic if you choose to do that in a business rule

 

var intValue = 100;
var intStr = intValue.toString();
intStr += "%";
gs.info('intValue = ' + intValue + ', intStr = ' +intStr);

If used in a business rule, delete line 1 and change line 2 to 

var intStr = current.u_max_user_count.toString();

use the correct column name for u_max_user_count.

Hi, 

Sorry may be my example was wrong in question.

what ever value is given in "Max Users count" field is should be considered as 100%. 

Then, there is one more field it should populate percentage of users added to table sys_user table based on "Max Users count" field.

created new field and calculated % of field, issue resolved