Skip to main content
stephenk0001
March 22, 2022
Solved

Use change within a Read Only grid to display a button

  • March 22, 2022
  • 7 replies
  • 0 views

Hi, all

I'm relatively new to Appian and I need a bit of help.

I have an interface that displays a read only grid..

I use a record action which runs in a dialog box.

Once the record action is run, the grid refreshes and displays the data that has been entered.

I have a "Submit" button which I would like to hide whilst the read only grid has no data to display.

Any advice would be helpful.

Thanks

Stephen

Best answer by gopalk2865

HI stephenk0001, As Stefan said , you can use showWhen parameter of the button and you can use a!isNotNullOrEmpty function to check the data that feeds the grid. If you are using local variable to populate the data into grid then your condition would be something like below

a!buttonWidget(

showWhen:a!isNotNullOrEmpty(local!gridData)

),

or if you have other values then you can use those values also to decide the visibility of the button.

7 replies

stefanhelzle0001
Brainy
March 22, 2022

The button component has a showWhen parameter. Create a condition checking for existing data and pass the result to this parameter.

gopalk2865
Participating Frequently
March 22, 2022

HI stephenk0001, As Stefan said , you can use showWhen parameter of the button and you can use a!isNotNullOrEmpty function to check the data that feeds the grid. If you are using local variable to populate the data into grid then your condition would be something like below

a!buttonWidget(

showWhen:a!isNotNullOrEmpty(local!gridData)

),

or if you have other values then you can use those values also to decide the visibility of the button.

harshitb6843
March 22, 2022

Remember [mention:43b7d4a83a2f4a89ab88fae153c3c34f:e9ed411860ed4f2ba0265705b8793d05] that a!isNullOrEmpty doesn't work with a CDT. For that, you will have to build your custom function. 

stephenk0001
March 23, 2022

Thanks team

In the end I needed to use the showWhen and write a query referencing my recordType.

stefanhelzle0001
Brainy
March 23, 2022

I hope you did not directly write that query in the grid. Querying the DB for each row will become a performance issue.

stephenk0001
March 23, 2022

Hi Stefan

I wrote the query in a showWhen on the button itself.

I only need to see the grid is not empty.

stephenk0001
March 24, 2022

So

I can't use the "showWhen" attribute to hide the "Submit" button - testing showed that although it seemed to work in the interface, it did not work in Tempo.

One of my colleagues suggested I should rather use validation to ensure the grid cannot be empty.

That solution accomplishes my purpose.

Thanks all for your input!