How to hide UI action button based on condition

vidhya_mouli
Giga Sage

I have a UI button Ready for delivery. This button should be visible only when the stage is in_progress. When user clicks on this button, it should update the stage to ready_for_delivery and hide this button. How do I do this?

 

I am updating the stage through a flow.

 

vidhya_mouli_0-1715347637969.png

 

 

 

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @vidhya_mouli ,

I tried your problem in my PDI and it works for me. In your UI Action add below condition 

current.state == 'ready_for_delivery' (In string)

 

SarthakKashyap_0-1715427877109.png

Note: If you are using current.state you need to be client to false so that's why it works 

 

Result 

SarthakKashyap_1-1715427957222.png

 

SarthakKashyap_2-1715427995349.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

View solution in original post

8 REPLIES 8

Community Alums
Not applicable

Hi @vidhya_mouli ,

I tried your problem in my PDI and it works for me. In your UI Action add below condition 

current.state == 'ready_for_delivery' (In string)

 

SarthakKashyap_0-1715427877109.png

Note: If you are using current.state you need to be client to false so that's why it works 

 

Result 

SarthakKashyap_1-1715427957222.png

 

SarthakKashyap_2-1715427995349.png

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak

This worked thanks. But I have another issue now. When I click on the button, the stage changes as expected. But the button does not disappear immediately. I had to refresh the page. How do I make ti disappear immediately.

Community Alums
Not applicable

Hi @vidhya_mouli ,

You need to change the state and save the form than the button will show and hide basied on your condition 

SarthakKashyap_0-1715446899068.png

 

Now I change the state and save the form

SarthakKashyap_1-1715446951716.png

 

 

Please mark my answer correct and helpful if this works for you

Thanks and Regards 

Sarthak 

This button is not in the back end. It is in the agent workspace.