I want to hide UI action once clicked.

Vaishnav1698
Giga Contributor

I created a UI Action named "xyz" when it is clicked it is redirecting to some form link. The link was setup in UI Action script only. In the condition field also there several conditions which required to show the button in the change_request form. Now, I want the UI button on the change form hidden when it is clicked once.
Limitations:

We cannot create a flag variable

We cannot use DOM manipulation
We cannot use sessionstorage as the button might appear again.

We cannot use the condition field of UI action bcoz it already exceeded the character max length.

There is no field change or popup message appears, so we cannot control visibility on states.

Is there any alternative way? @Earl Duque Can you help on this?

4 REPLIES 4

Ankur Bawiskar
Tera Patron

@Vaishnav1698 

Unless you keep a track of whether button is clicked or not how will system know if UI action needs to be shown/hidden.

You can use a hidden form field and then use that in condition.

if max length is reached for UI action condition field then call script include function and move your condition to script include function and return true/false

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Vaishnav1698 

Hope you are doing good.

Did my reply answer your question?

💡 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  ||  10x ServiceNow MVP  ||  ServiceNow Community Leader

@Ankur Bawiskar I understand, that was my initial approach of creating a flag variable and hide it on from. But we cannot a custom variable as there are some limitations to it and also in condition, exisiting conditions they are 2 script include functions in it to show the button. But now they want when it is clicked once it should be hidden immediately.

Without these steps:-

We cannot create a flag variable

We cannot use DOM manipulation
We cannot use sessionstorage as the button might appear again.

We cannot use the condition field of UI action bcoz it already exceeded the character max length.

There is no field change or popup message appears, so we cannot control visibility on states.

@Vaishnav1698 

then this is not feasible to implement.

I suggest you to reach out to Customer's technical architect asking about the approach if they don't wish to use the above.

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