If else condition in BR

Lusifer1984
Tera Contributor

I want to write a BR so that 

 

I need to write in BR please help with the cide.
 
       if(current.subject_person.u_work_country == " London") {
            current.assignment_group = " Windows ";
else 
 if(current.subject_person.u_work_country == " France")
  current.assignment_group = "Unix"
 
 
4 REPLIES 4

SN_Learn
Kilo Patron
Kilo Patron

@Lusifer1984 ,

 

Try the below :

 

 if(current.subject_person.u_work_country == "London") {
            current.assignment_group = "<sys_id_of_windows_group>";
}
else if(current.subject_person.u_work_country == "France"){
  current.assignment_group = "<sys_id_of_unix_group>"
}

 

----------------------------------------------------------------
Mark this as Helpful / Accept the Solution if this helps.

Sarthak Kashyap
Tera Expert

Hi @Lusifer1984 ,

Please pas the sys_id of the assignment group 

 

if(current.subject_person.u_work_country == " London") {
            current.assignment_group = "sys_id";
else 
 if(current.subject_person.u_work_country == " France")
  current.assignment_group = "sys_id"

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

vishwajeet5550
Mega Guru

This If Else condition is correct but you can put the sys_id of Assignment_group on "Windows" and "Unix"

 

AndersBGS
Tera Patron
Tera Patron

Hi @Lusifer1984 ,

 

Remember that the current.assignment group is a reference field, hence SysID should be typed in instead of the name as @SN_Learn has suggested.

 

If my answer has helped with your question, please mark my answer as the accepted solution and give a thumbs up.

Best regards
Anders

Rising star 2024
MVP 2025
linkedIn: https://www.linkedin.com/in/andersskovbjerg/