Questions about buttons in the record workspace

C_dric Chen
Tera Contributor

Greetings, people.

Here are my questions:

  1. In a workspace, is it possible to make buttons appear/disappear based on the value of the "state" field? For example: When the "state" changes to "Work in progress", the button would appear. When the "state" changes to "Closed complete", "Closed skipped", etc., the button would disappear.
  2. OTOH, is it possible to automatically update the label of any given button based on the value of the "state" field? For example: When the "state" is "Open", the button's label would be "Assign to me". When the "state" is "Work in progress", the button's label would be "Mark as complete".

Thank you in advance!

1 ACCEPTED SOLUTION

I'll provide some screenshots.  To clarify here, a UI action (button) will need a script to perform some type of action, however, referencing your question, the button being shown is based on the condition in the UI action record.

This is screenshot of an example UI Action I made, it doesn't do anything, but will demonstrate how the UI action (button) will appear and disappear based on the State value on an Incident record. In the condition field, you can see I have the condition set to current.state == 2 (2 being the value of In Progress in the State field). This value being set will only show this button when: I am on the incident table, and the value of State is In Progress, otherwise it will be hidden.

find_real_file.png

The next screenshot shows an incident that is newly created, note the UI actions shown at the top of the incident, you do not see the newly created one, Show only in WiP.

find_real_file.png

Now, I have changed the State to In Progress (which its value is 2, which is what is in the condition) and saved the record. Now, note the UI actions that are available, you will see the Show only in WiP button is now showing.

find_real_file.png

Now in the next picture, I have changed the state to Closed.  Note the UI action Show only in WiP is now gone.

find_real_file.png

So, to recap, the UI Action (button) you wish to show/hide based on a value in a field, go to the UI Action record and change the condition field to meet your need. Make sure to select a condition where you wish to show the UI Action, as when the condition is not met, it will be hidden.  The UI Actions in Agent Workspace still use the same UI Action records, so the process would be the same for that as well. I hope this cleared up your questions.

If this solved your issue, please mark this response correct and helpful, thank you!

 

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

View solution in original post

5 REPLIES 5

Zach Koch
Giga Sage
Giga Sage

This link may help you, it mentions using the Conditions in the UI action(button) to show or hide it based on a fields value.

Hiding ui actions

If this solved your issue, please mark this response correct and helpful, thank you!

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

Good afternoon, Zach.

Do you happen to have a screenshot of the UI action itself? I only see the screenshot of a client script in the link that you provided.

Sorry if this might seem like a n00b question to you, since I am a n00b myself.

I'll provide some screenshots.  To clarify here, a UI action (button) will need a script to perform some type of action, however, referencing your question, the button being shown is based on the condition in the UI action record.

This is screenshot of an example UI Action I made, it doesn't do anything, but will demonstrate how the UI action (button) will appear and disappear based on the State value on an Incident record. In the condition field, you can see I have the condition set to current.state == 2 (2 being the value of In Progress in the State field). This value being set will only show this button when: I am on the incident table, and the value of State is In Progress, otherwise it will be hidden.

find_real_file.png

The next screenshot shows an incident that is newly created, note the UI actions shown at the top of the incident, you do not see the newly created one, Show only in WiP.

find_real_file.png

Now, I have changed the State to In Progress (which its value is 2, which is what is in the condition) and saved the record. Now, note the UI actions that are available, you will see the Show only in WiP button is now showing.

find_real_file.png

Now in the next picture, I have changed the state to Closed.  Note the UI action Show only in WiP is now gone.

find_real_file.png

So, to recap, the UI Action (button) you wish to show/hide based on a value in a field, go to the UI Action record and change the condition field to meet your need. Make sure to select a condition where you wish to show the UI Action, as when the condition is not met, it will be hidden.  The UI Actions in Agent Workspace still use the same UI Action records, so the process would be the same for that as well. I hope this cleared up your questions.

If this solved your issue, please mark this response correct and helpful, thank you!

 

If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!

Good morning, Zach.

These are all very helpful. Thank you very much!

Now, if you don't mind, I'd like to ask a follow-up question: How do I map this UI action to a specific button?

Thank you again!