- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 11:35 PM
Hello,
I have a requirement that is user selected in the catalog item variable(single line text) approval will goes to the person existing in the variable.
Please help me to achieve this.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:29 AM
Hello @Servicenow de11 ,
Use this-
and use this script -
var answer = getAnswer();
function getAnswer(){
var user = current.variables.YourRequiredField.toString();
var grUser = new GlideRecord('sys_user');
grUser.addQuery('name',user);
if(grUser.next()){
return grUser.sys_id;
}
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 11:43 PM
Hello @Servicenow de11
If it is single line text then you need to first
Lookup record where name is that single line text
Then ask for approval and drag and drop Lookedup record.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-26-2023 11:56 PM
Hello Harsh deep,
If the user selects his name then manager hr partner will autopopulate in that single line text then approval will goes to that user manager hr partner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:03 AM
Hello @Servicenow de11
If it is single line text then it will not send approval,
For that you need reference field.
That's why I told you to lookup record first.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2023 12:10 AM - edited 10-27-2023 12:11 AM
Hr partner field is the string field in the user's table. If i take variable as reference field then user's manager hr partner is not auto populating so i took variable as single line text.
Is their any other way or script in the workflow to trigger the approval to users manager hr partner