Existing catalogue form will be visible to All Users

Srinivasu2
Tera Contributor

Hi Community,

 

Existing catalogue form will be visible to All the Users, But is there any way to modify existing workflow where if the user is Brazil then the request should land to Brazil assignment group.

 

 

Regards,

Srinivasu Sagiraju

 

17 REPLIES 17

In if condition we should call variable right, generally  we use current.variables.variablename

 

for this should we create a variable in existing catalog item

@Srinivasu2 how do you Identify an user? If the user record have country name you can use that, other wise you can create a variable and store it and you can use it in Workflow

Thanks,
Anvesh

Could you please share code for this requirement in if condition

 

Regards,

Srinivasu Sagiraju

Anand Kumar P
Giga Patron
Giga Patron

Hi @Srinivasu2 ,

In the "Script" activity, write a script that evaluates the user's location.

var userLocation = gs.getUser().getLocation();
workflow.scratchpad.userLocation = userLocation;
//In if condition of another activity use below code
workflow.scratchpad.userLocation == 'Brazil'

 Then add add a decision step (If) after the script activity. In the decision step, create a condition to check if the user is in Brazil.

Create two different branches coming out of the decision step with branch activity:

  • If the condition is true (user is in Brazil), route the request to the Brazil assignment group by adding a "Set Values" activity and setting the assignment group field to the Brazil assignment group.

  • If the condition is false (user is not in Brazil), route the request to the default assignment group or any other group as needed.

Thanks,

Anand

Ok Thank you, should we use one Run script activity and two if activities to achieve this requirement?