How to edit the UI action on "Actions on selected rows" on sc_task table, under Approvers tab?

AbdurRahmanSnow
Giga Guru

Good evening.!
How to edit this UI action button "Request approval" on sc_task table, under Approvers tab?

AbdurRahmanSnow_0-1762793297346.png

I want to either edit it to write a script or, remove it? Please help. (Also, please ignore the other "Request Approval" button on the context menu. That is a custom button.)

AbdurRahmanSnow_1-1762793471698.png

@Ankur Bawiskar @Dr Atul G- LNG @Viraj Hudlikar 

1 ACCEPTED SOLUTION

tejarekanda
Tera Expert

I think, We can’t hide a UI Action from the list Choice (like on sc_task) using a condition 

However, we can disable the functionality of that UI Action instead.

I handled this by creating a Script Include to check the table name and then used it in the UI Action’s condition.
Script Include:

tejarekanda_0-1763040120067.png

 

Ui action:

tejarekanda_1-1763040169378.png

Result:
sc_req_item table:

tejarekanda_2-1763040241586.png


sc_task table:

tejarekanda_3-1763040299977.png

Regards,
Teja

View solution in original post

19 REPLIES 19

@AbdurRahmanSnow 

in that List action you can check the parent table name

which OOTB List action is that? share here

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 
Here, is the screenshot of that UI action. I need to restrict this button visibility on sc_task table. 

AbdurRahmanSnow_0-1762968568908.png

AbdurRahmanSnow_1-1762968607869.png

 

@AbdurRahmanSnow 

if you don't want this button for sc_task then add this in UI action condition

current.state == 'requested' && current.source_table != 'sc_task'

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi @Ankur Bawiskar 
This condition is not working. Still the "Request approval" button is showing on sc_task table.
Please help.

@AbdurRahmanSnow 

In my earlier response it should be this

current.state == 'not requested' && current.source_table != 'sc_task'

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader