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

Problem with multiple triggers in button

Hey all,

I have a button that has multiple triggers. First, it does Select Possible on a given field, then it does Set Variable to GetFieldSelections([SameField], ',').  I put the contents of the variable in a text box for testing purposes.  The first time I hit the button (assuming the variable is empty initially), it does select the possible values for the field but the variable remains nothing.  However, if I hit the button again the variable shows up as expected.  Why is it not picking up the selected values in the first pass? Do changes from one trigger not register with the subsequent trigger?

To clarify even further, lets say I have two list boxes, Name and ConcatenatedNameAndID.  I choose two names.  Hit the button and the related ConcatenatedNameAndID are chosen, however the variable does not change.  Now deselect one name and hit the button.  The variable is set to the the two names not just one.  So, it is sort of a step behind.

I have attached a sample.  Any help would be greatly appreciated.

5 Replies
swuehl
MVP
MVP

Heather,

please check

http://community.qlik.com/thread/41644

Like discussed in that thread, I also believe that all the actions will act on the state as seen when trigger fired.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Heather,

With multiple actions on a single click the state of some of things carried out on previous steps are not always as you expect on later steps.

With the example you uploaded would it not give the desired result if you had the following in the expression for the set variable?:

=NOW() & '  ' & Concat([Query String Concat], ',')

Regards,

Steve

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

Not applicable
Author

I can do that, however, this was just an example.  After I wrote this I did what you suggested.  But now the button has two actions.  The first selects possible on a field, which should then change the value of that variable, and then Open URL with the URL from the variable.  It would seem that the actions do not recognize each other.

stevedark
Partner Ambassador/MVP
Partner Ambassador/MVP

Could you not call the URL with the value that you are putting into the variable, rather than needing the variable to be set first?

If you upload an example of it not working I could take a look for you.

Steve

Not applicable
Author

That's so nice of you.  But I think I have it figured out, just kept looking up different functions until something worked.  Instead of GetFieldSelections, I just used Concat(fieldname, ',').  I'm just disappointed the action chaining in the button and macros do not work in AJAX.  Again, thanks so much for the offer and the response.