Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Assigning Trigger to Hidden Field?

I have designed an interface that required some island tables that store meta data in them.  Since that data is of no use to the end user, I hide it.  However, that removed my trigger on the field and when I view the Triggers properties, the hidden fields do not appear and there is no Show System fields option.  Is there a way to assign a trigger to a Hidden field?  Perhaps through a Macro that triggers on document load?  Thanks.

10 Replies
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Given that these fields are hidden from the user and are data islands how are they getting selected?

If no selection is being made then nothing would be triggered anyway.  If you are using an Action to select a value in the the hidden field then you could also assign whatever you were going to put in that trigger to the same sequence of actions.

Worst case scenario I guess that you would have to not have all the fields hidden, but perhaps use a different prefix to your hide prefix to denote that these fields are not of direct interest to users.

Steve

Not applicable
Author

The fields are in list boxes where they are selected by the user.  I hid them so that their values would not appear in the Current Selections object.

Basically, I have a data island that contains meta data that acts like a menu so to speak.  The user selects from the list box with a field from the data island.  This contains several topics such as Country.  When you select Country, it populates a second list box with the Country field via a trigger.

Data Selection.PNG

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Where there are only a few values I tend to use variables and set them via actions called from text boxes.  You could use buttons, but text boxes give you a bit more flexibility with layout and style.  This is more performant than data islands, but can be tedious if you get to too many values.  I've attached an example of setting variables in this way.

Where I have had a longer list of items before (or one that needs to be dynamic) I have had the values in a field that is not hidden, and shown in a straight table chart.  When one of the values is selected a trigger fires to set a variable to the minimum value in that field (the selected value) and then in the next action clear the selections on that field (so it does not appear in current selections).  The variable is then used to apply a background colour to the cell that was selected in the chart - giving the look of a selected field in a list box.  The variable is then available for other purposes also.

From where you are the simplest way to get the dynamic listbox is to ensure the values in your selection list boxes match the field names in your data model, you can then put an <Expression> as the list box field and set this to =minstring(FieldSelection) .

Hope that helps.

- Steve

larry_w_
Contributor III
Contributor III

If hidden fields are hidden in the triggers tab of document properties, just right click on the sheet and choose "Properties", then in the fields tab click on "Show System Fields".  Then if you go back to document properties, trigger tab, the hidden fields are visible.

IAMDV
Luminary Alumni
Luminary Alumni

Hi,

1. Go to User Preferences (ALT + CTRL + U)

2. Under General Tab > Check the option - "Show System Fields"

3. Go to Document Properties (ALT + CTRL + D)

4. Assign your Action(s) to relevant Trigger

5. Go back to User Preferences (ALT + CTRL + U)

6. Uncheck the option > Check the option - "Show System Fields"

This way you can capture the Triggers and also not allow any user to add the System Fields in UI.

Thanks,

DV

www.QlikShare.com

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

I have done something similar in some recent apps without needing to resort to triggers and variables. I created a hierarchy listbox and a second litsbox to display the values of the field selected in the first listbox. In my case, the first list box showed the models fields organised by table (using the $Field system field). The second list box used the expression:

=[$(=$Field)]

In your case, the data island would display in the first list box, and the expression for the second one would be the same as above, with $Field replaced by the name of your "field-name field".

See the attached qvw for a sample. The detail box and the second list box have no meaning unless something is selected in the first list box, so they can be hidden based on GetSelectedCount.

Untitled.png

Hope that's useful

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

My application illustrating this solution has been moved to a new location, and can now be found here:

http://community.qlik.com/docs/DOC-4319

Steve

http://www.quickintelligence.co.uk/

yakir_manor
Contributor III
Contributor III

do this:

on any sheet -> right click -> new sheet object -> table box... -> general tab -> check 'show system fields' -> ok

now you can go to document properties and you'll see that hidden field, you can also delete the table if you want it was only to create hidden field

sunilkumarqv
Specialist II
Specialist II

Actually triggers are working for me

plz find the attached for more info...