- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 10:18 PM
In virtual agent, the case creation on HR services should change based on the logged in user's home country,is that possible? how?
Example: So if user is from India the HR service should be General Inquiry or if user from US the HR service should be Payroll
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:39 PM
you will require script for this
use the Script action and check which country logged in user belongs
Then use Decision and based on that use Record action
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023 09:51 PM
update as this
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('user',vaInputs.user.sys_id);
gr.query();
if(gr.next()) {
var location = gr.country_of_birth.getDisplayValue();
vaVars.location = location;
}
})()
then in decision use the exact country name to match in IF
if(vaVars.location=='United States of America'){
return true;
}
else{
return false;
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2023 11:39 PM
you will require script for this
use the Script action and check which country logged in user belongs
Then use Decision and based on that use Record action
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 03:56 AM
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('sys_id',user);
gr.query();
if(gr.next()) {
var location = gr.country_of_birth;
vaVars.location = location; }
})()
This is the script action I have used but this is not taking me to the next decision flow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2023 04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-12-2023 09:51 PM
update as this
var gr = new GlideRecord('sn_hr_core_profile');
gr.addQuery('user',vaInputs.user.sys_id);
gr.query();
if(gr.next()) {
var location = gr.country_of_birth.getDisplayValue();
vaVars.location = location;
}
})()
then in decision use the exact country name to match in IF
if(vaVars.location=='United States of America'){
return true;
}
else{
return false;
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader