More robust expression condition

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

Moderator: Martin

Locked
User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

More robust expression condition

Post by MURTUMA » 04 Mar 2014 20:38

I was thinking that if you could expand the possibilities to make out going branches from the expression condition? Something like this:

Variable_x == "value_y"
Lets say there are five possible values for value_y from 0 to 4. When continuing forward from said expression element, instead of true and false branch, we could have braches for all the values we test in the condition.

Some possibilities:
Name of the first branch is 0. And if value_y is 0 it follows that branch.
Second branch could include values 1 and 2...
Third branch includes value 3 and so on...

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: More robust expression condition

Post by Martin » 04 Mar 2014 21:22

I have something on my list of features under consideration that sounds similar:
There could be a way to add an expression to all connections, even between two actions. The flow would only continue on this connection when the expression evaluates to true.
Using this mechanism you would not need a condition Expression in many situations anymore.

For example when using an input dialog that shows a list like a menu to select a value between 1 and 4.
You could build a flow to process the result like this:
-trigger ...
-action Input Dialog
--[value=="1"]--> action Vibrate
--[value=="2"]--> action Sound
--[value=="3"]--> action Call number
--[value=="4"]--> action Send Mail

It's like adding four conditions Expression but would save some space.

User avatar
MURTUMA
Posts: 697
Joined: 05 Mar 2013 22:43

Re: More robust expression condition

Post by MURTUMA » 04 Mar 2014 22:28

Yeah, that's just what I meant. You just said it much better.

lchiocca
Posts: 69
Joined: 15 Aug 2013 10:11

Re: More robust expression condition

Post by lchiocca » 13 Mar 2014 10:39

Probably to make it more "type-safe", Martin could add a new data type: enum :). That way you could define what enum values are available and the conditional would simply be a "switch()" (to put it in java terms)

Locked