Action button only available conditionally

Is it possible to have an action button appear conditionally? For example, I’d like the View and Add action buttons in the below detail view to not be available should the Production Stop Time column have a value. I put an equation on the System Add action Only if this condition is true of: ISBLANK([Transaction ID].[Production stop time]).

In the Runs for the day reference view, each of the rows are part of the Daily Production Report table with rows keyed with Transaction ID.

Doesn’t seem to make the action button go away though!

Thank you in advance!

Yes.

View is not, technically speaking, an action button. There is no way to hide View.

Add is displayed because the table or slice referenced by the items in the list allows adds. To hide the Add button, point your list to a table or slice that doesn’t allow adds. Your case is a little complex, though:

In that case, you’ll need two columns: one for the list that references a table or slice that allows adds, and one for a slice that does not allow adds. Then, use Show? expressions for each to show or hide when appropriate.

2 Likes

Thanks Steve for the assistance, I’ll run with this!

3 Likes

Can you share with me your sample please? I am running into a similar scenario.

Hi @timutana, based on Steve’s advice, I ended up getting this to work. In my case, we have some machines that make a product. The machine operators record their Runs on the machine for each day. I wanted it so that if the daily report was open they could add and edit the Runs. But once they “punched out” for the day and submitted the report they could only view the runs. No adds or deletes.

I ended up creating two virtual columns.

One was “Runs for the day” which had a Show if of “ISBLANK([Transaction ID].[Production stop time])” and pointed to an Open ticket runs slice of the Runs table. The slice allowed Adds and Updates.

The second was a “Runs for the day - production closed” virtual column which had a Show if of “ISNOTBLANK([Transaction ID].[Production stop time])” and pointed to a Closed ticket runs slice of the Runs table. The slice was Read only.

Both slices were the exact same info, no conditions on the slice other that the one allowing add/updates and the other being view only.

At the end of the day you have a few things going on. You have 2 virtual columns, each with a show if condition. And each virtual column reference a different slice of the same table. One slice being Read only.

Would this work for you? What’s your application?

4 Likes

Well done!

1 Like

I solved my problem using a solution which is similar to yours. I think it was Steves answer as well.
I created two virtual columns and then used a show condition to show and hide which table.
Thank you ver much for taking out the time to help me.
Have an awesome week mate.

1 Like

Thanks for all the help and suggestions you provide.
I found a solution with a suggestion you made on another post.
Take care mate.

1 Like

Great!

1 Like