In virtual agent,based on user's home country the case creation for HR services should change

Nive G
Tera Contributor

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

 

2 ACCEPTED SOLUTIONS

@Nive G 

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

 

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

@Nive G 

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.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

View solution in original post

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@Nive G 

so what debugging did you perform?

did you check the topic flow?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Is this only possible through script?

@Nive G 

can you share where is this exactly required? share some screenshots

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

This is the flow,I have used record action to create a HR case,so in this place if the logged in user is from US then case should be created for Payroll HR service and if the user id from India then case should be of General Inquiry