Post your questions and help other users.
Moderator: Martin
-
kintrupf
- Posts: 257
- Joined: 10 Sep 2013 08:59
Post
by kintrupf » 26 Nov 2013 12:17
When a value is added to or removed from a global list variable a trigger associated with the variable is not fired.
Example:
I have a trigger where I want to respond to changes in the list
global_testList.
In a flow I add or remove values to the list
global_testList with the functions
addElement and
removeElementValue like this:
Code: Select all
global_testList = addElement(global_testList, 'Test')
global_testList = removeElementValue(global_testList, 'Test')
global_testList = addElement(global_testList, 'Test2')
The trigger above is only fired when the list is assigned first (or created), but never on the subsequent changes of its contents.
-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 02 Dec 2013 18:03
Hi,
That's the intended behavior. A trigger Global Variable is only executed when another value is assigned to a global variable which is not the case when a list is modified by adding/removing an element. The global variable still points to the same list in such a case.
You could use another variable which is incremented by one when you modify the list and trigger on this variable.
Regards,
Martin
-
kintrupf
- Posts: 257
- Joined: 10 Sep 2013 08:59
Post
by kintrupf » 03 Dec 2013 07:00
Martin wrote:The global variable still points to the same list in such a case.
Currently I use an "Execute flow" action afterwards to call the flow that should have been triggered by changing the list variable.
It works but I need to remember to put it into each flow. And since I use that variable a lot in my flows it tends to clutter the flows somewhat
