Question

Using list box value issues

  • 8 October 2020
  • 1 reply
  • 60 views

Badge +5

Hi All. 

I have a Smart Form that loads a list box control with multiple values from a smart object. It works perfectly, however, I would like to hide the control if it doesnt contain values. I have a task that loads and shows multiple values in the list box and I want to do a check for the box being empty to hide the control otherwise. However even with values in the box, when I try to check the values by pulling the control or field related to it in a message it always shows as empty even with data. This messes up my ability to hide the control if there are no values to show. Any ideas? I have tried pulling from the associated smartobject as well as the control and nothing.


1 reply

Badge

Hi @FrozenForms 

To solve the first issue of hiding the box if there are no values. You create a rule which will check the field for values and if it is empty, then hide the control.

You can do this on the form by going to rules, and either creating a new rule or adding to an existing rule for when the form initializes. 

Then in conditions, select, “a control on a view does not contain a value”, configure the rule correctly by selecting the view being used, and then also the control on the view (the box list); and then in Actions, select, “Hide a view control” also selecting the correct view and the correct control.
This should check for values in the box list control and if it is empty, will hide the control.

The second part of you question needs a bit more detail, is your smartobject connected to a database? Or is it using K2 Smartbox to store data.

Reply