user defined variables outside of actions

Post your feature requets for new triggers, conditions, actions and other improvements.

Moderator: Martin

Locked
nbi
Posts: 25
Joined: 30 Apr 2016 21:49

user defined variables outside of actions

Post by nbi » 13 May 2016 22:19

As a newbie maybe I'm missing something, but based on the documentation and examples I found it seems the only way to introduce a user defined variable in a flow is via the Script Action.

That seems rather awkward. Whenever a new user defined variable is needed an action must be created. Seems like this has potential for introducing unnecessary actions in flows.

Automagic is already handling pre-defined variables in Triggers and Conditions. Why can''t the drop down list of variables include a "custom" type for which the user supplies a constant or expression?

I'm not suggesting that Script be modified or eliminated, but simply adding the ability to introduce user defined variables in non-action elements.
Thanks for listening.

User avatar
Bushmills
Posts: 286
Joined: 23 Sep 2014 21:56

Re: user defined variables outside of actions

Post by Bushmills » 14 May 2016 08:17

Variables can be used in many more places than Script actions. You may have to embed their names between {curly braces}. Variables with names starting with "global_" show in the list of variables.
Assignment to variables outside of script action is possible too, again by placing the statement between curly brackets. Variable names don't need to start with "global_" if they're used within the same flow.
Example of assigning, then using the same variable, in a notification display action:
Screenshot_2016-05-19-13-30-19.png
Screenshot_2016-05-19-13-30-19.png (70.32 KiB) Viewed 7255 times

Locked