- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 10:18 AM - edited 09-04-2023 10:19 AM
Hi ,
I have below requirement, How to validate below validation....
there is one field on my custom table which is of numeric type.
Gross value.
based on the Gross value entered the approval should trigger to below hierachy.
Requestor gets approval request (if value of Gross value entered between = 1-100)
Requestor manager gets approval request.(if value of Gross value entered between = 101-200)
Requestor manager->manager gets approval request.(if value of Gross value entered between = 201-300)
the below is the scenario.
how to configure the below validation in workflow and get the approval request?
Anyone has idea? Please share ....
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 09:41 PM
add one more else if statement,
else if(grossValue>=1000){
var userGR = new GlideRecord("sys_user");
userGR.get("title", "President");
return userGR.getUniqueValue();
}
Mark the response as helpful & correct if it resolves your query, so the thread can be closed.
Aman Kumar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 10:24 AM
create one approval activity and in the script you can write something as:
Just validate variable names, writing code from memory
answer = checkApproval();
function checkApproval(){
var grossValue = current.variables.gross_value;//check your variable name
if(grossValue >= 1 && grossValue <= 100){
return current.request.requested_for;
}
else if(grossValue >=101 && grossValue <=200){
return current.request.requested_for.manager;
}
else{
return current.request.requested_for.manager,manager;
}
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 10:49 AM
Thanks for the response ..
there is one scenario for the below requirement.
if gross value is above 1000 the President (user table the title of President) need to get approval request.
how can i fetch the president details and add the approval request.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2023 09:41 PM
add one more else if statement,
else if(grossValue>=1000){
var userGR = new GlideRecord("sys_user");
userGR.get("title", "President");
return userGR.getUniqueValue();
}
Mark the response as helpful & correct if it resolves your query, so the thread can be closed.
Aman Kumar