UI action Condition

Abhilasha G T
Tera Contributor

Hi Team,

 

I want to put a condition on Cancel Request UI Action, this button should only be available/visible on RITMs whose Item belongs to the Service Catalog.

 

How write a condition on this Requirement.

 

Regards,

Abhilasha G T

 

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

then update the UI action condition as this

give the correct sysId of Service Catalog

your existing condition && current.cat_item.sc_catalogs.toString().indexOf('e0d08b13c3330100c8b837659bba8fb4') > -1

AnkurBawiskar_0-1743602004423.png

 

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

4 REPLIES 4

Community Alums
Not applicable

Hi @Abhilasha G T ,

On your existing UI action condition, just add  " && current.cat_item.name != 'Your Item Name' "

 

 

Hi Sandeep,

 

Thanks for the reply,

having N numbers of catalog items, is this query will work.

 

Regards,

Abhilasha G T

Ankur Bawiskar
Tera Patron
Tera Patron

@Abhilasha G T 

then update the UI action condition as this

give the correct sysId of Service Catalog

your existing condition && current.cat_item.sc_catalogs.toString().indexOf('e0d08b13c3330100c8b837659bba8fb4') > -1

AnkurBawiskar_0-1743602004423.png

 

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

@Abhilasha G T 

if you want to check for catalog item names then do this

1) create string type system property and add catalog item name as comma separated values

2) update condition as this

existing condition && gs.getProperty('propertyName').indexOf(current.cat_item.name.toString()) > -1

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