How to set condition on UI Action

Zosy
Giga Contributor

Team ...

Need your assistance  here 

 

I am testing a UI Action Button but would like it to only appear for the Emergency change type.

 

In the UI action, there is a Condition box.

What is the condition script code I need to type in for the button to only be visible for the Emergency Change type?

 Many thanks for your help! 

 

Zosy

1 ACCEPTED SOLUTION

Tony Chatfield1
Kilo Patron

Hi, if you check OOB UI actions there are a couple with conditions based on (or including) change 'type'
/sys_ui_action_list.do?sysparm_query=table%3Dchange_request%5EconditionLIKEcurrent.type&sysparm_view=

Based on the formatting\syntax of the examples you should  be able to see that you need something like this

current.type == 'emergency'


   

View solution in original post

7 REPLIES 7

Tony Chatfield1
Kilo Patron

Hi, if you check OOB UI actions there are a couple with conditions based on (or including) change 'type'
/sys_ui_action_list.do?sysparm_query=table%3Dchange_request%5EconditionLIKEcurrent.type&sysparm_view=

Based on the formatting\syntax of the examples you should  be able to see that you need something like this

current.type == 'emergency'


   

Mohammed Kemal
Tera Guru

Hi Zosk,

What condition would you like to set in the UI Action?

There is a field called condition in the UI Action form 

For example: you can do something like this bellow in the UI Action called work In Progress: 

(current.state == '1') && ((current.assigned_to == gs.getUserID()) || gs.hasRole('sn_grc.manager'))

find_real_file.png

Thanks!

 

 

Ujjawal Vishnoi
Mega Sage
Mega Sage

Hi @Zosy ,

Please enclose your existing condition in () and then add like below.

(existing condition here) && current.type=='emergency'

 

Hope it helps.

Hi @Zosy 

If I helped you to resolve your query with my answer. Then I would really appreciate if you can mark my answer correct and helpful. So that it can be moved to answered list and helpful for future readers.

Regards,
Ujjawal