Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Automatic Select in List Box

Hello!  How can I automatic select a record from a field in my list box...  I tried setting the sheet properties , then triggers  and on select but it doesn't allow me to unselect and  select a different record.

For Example :

Phones  (field):

Apple

HTC

Samsung

In my example above, I just want to automatic select  "Apple"  the first thing I open the file but it will allow me to unselect and select another phones like SAMSUNG.  Is this possible?

1 Solution

Accepted Solutions
Not applicable
Author

create the OnOpen trigger as specified above but make sure 'Always one selected value' is *not* ticked

View solution in original post

7 Replies
Not applicable
Author

Select 'Apple' ,go to listbox properties & tick 'Always one selected value'.

Save and close the document.

tresesco
MVP
MVP

Use 'OnOpen' event like attached sample.

sushil353
Master II
Master II

Hi,

Try to setup a trigger in document property>Triggers>Document Event Triggers>OnOpen>Select in field

Specify your field name and search string.

HTH

Sushil

Anonymous
Not applicable
Author

Thanks you, guys for the helpful advise.. all suggestions allows me to select and unselect  but it does not allow me to clear all my selections.

Not applicable
Author

create the OnOpen trigger as specified above but make sure 'Always one selected value' is *not* ticked

rustyfishbones
Master II
Master II

Create the open trigger and add an external action and choose run macro =  SelectRandom

Sub SelectRandom

val = ActiveDocument.Evaluate("FieldValue('Phones', ceil(" & Rnd() _

& " * FieldValueCount('Phones')))")

ActiveDocument.Fields("Phones").Select val

End Sub

This means when the document opens each time it will randomly select a value from the field Phones

Anonymous
Not applicable
Author

Kai,

I got it...This is what I exactly wanted.

Tks.