We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

Show/hide button on workspace list page

ShuRiseUp2023
Tera Expert

Hi Community:

I have a requirement to show the Approve button on the Workspace list page above the list only when the selected records' state is a certain state, eg. awaiting approval. When user select some records that the state is not that one, the Approve button won't be available. In the Action Assignment, I set the Record Conditions as: state is awaiting approval. but the button won't show at all even the selected records' state is correct.

How to show/hide this button?

Thanks a lot

5 REPLIES 5

Diogo Ramos
Tera Sage

Hello, 

I've done something similar, but instead of hiding the button, the button is just disabled and you cannot click on it if you select a record that does not match the conditions. 
 
I have 1 declarative action of type List, where I have the following fields set  (some fields might not be available on the form, you need to add them).

Record Selection Required = True 
Group By = True (you don't need this)
Group = (my specific group where I have the edit button and the close button, you don't need this)
Enable Dynamic Evaluation = True  --> docs
Dynamic Record conditions = for example (state != awaiting approval)

Then when the user selects multiple records, if one fails the condition the button is not available

DiogoRamos_0-1741198741687.png


For the enable dynamic evaluation, note that as per documentation: 
You may experience slowness and unresponsiveness if this feature is used in combination with theSelect All, which selects all records in a list, as conditions must be evaluated for all the selected records.

What I do, is also setting a max number of records the user can select, on my situation I have the action implemented as a client script because I need to do some ajax operations, so I use the count variable from the action modal : 

DiogoRamos_1-1741199067568.png


I hope this helps 🙂

Hello, I need your help.

I have set Dynamic Record Evaluation to true and configured the required conditions. It works correctly when I select up to 100 records on a single page view. However, it does not work when I use the Select All button.

When I use Select All, I have verified that all the selected records meet the configured conditions. I am 100% sure the conditions are satisfied, but I still receive an error.

I have attached a screenshot for reference. Could you please help me understand why this is happening?

1000016656.jpg

 

1000016655.jpg

 

Hello Rani, 

I tried on my PDI (glide-australia-02-11-2026__patch2-04-17-2026with a very simple button that would just print the sys_id in the logs of each record (Server side), and I got the same issue as you describe, so this must be some kind of protection built it by ServiceNow. I would advise you raise a ticket with support and let us all know what they find.

Remember they do say "You may experience slowness and unresponsiveness if this feature is used in combination with theSelect All, which selects all records in a list, as conditions must be evaluated for all the selected records." , but I was not aware of something else blocking this behaviour, I am also interested to know what SN would answer.

ShuRiseUp2023
Tera Expert

Thank you so much for your quick response. I don't know why in our instance; I can't enable dynamic evaluation. it's not checkable. 

ShuRiseUp2023_0-1741202758346.png