Profile based branches

Patrick Rodrigu
Tera Contributor

Hey all,

 

I'm currently making a topic that will create a ticket. Is there a way to check the logged in user's phone field and branch to different paths if the "phone" field is empty or populated?

Thank you!

1 ACCEPTED SOLUTION

Lynda1
Kilo Sage

We have topic branch based on if a certain ID is populated or not.  you can try the same

(function execute() {
var user = gs.getUserID();

var <Name> = new GlideRecord("sys_user");
<Name>.addQuery('sys_id', user);
<Name>.query();
if(<Name>.next()){
vaVars.acdID = acd.u_acd_id;
}
})()
 
Then in the branch decision, we added this and of coursed changed the code to the appropriate path
 
(function execute() {

if(vaVars.acdID != ""){
return false;
}
else{
return true;
}
 
})()

View solution in original post

1 REPLY 1

Lynda1
Kilo Sage

We have topic branch based on if a certain ID is populated or not.  you can try the same

(function execute() {
var user = gs.getUserID();

var <Name> = new GlideRecord("sys_user");
<Name>.addQuery('sys_id', user);
<Name>.query();
if(<Name>.next()){
vaVars.acdID = acd.u_acd_id;
}
})()
 
Then in the branch decision, we added this and of coursed changed the code to the appropriate path
 
(function execute() {

if(vaVars.acdID != ""){
return false;
}
else{
return true;
}
 
})()