Pass parameters with a flow

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

Moderator: Martin

Locked
ZSasha
Posts: 103
Joined: 11 Oct 2013 03:48

Pass parameters with a flow

Post by ZSasha » 13 May 2014 22:53

Hi Martyn,

Is it possible to add a parameter(s) to some actions, especially to those which are triggered by "OnClick" part of a widget?

Let's say I want to be able to change a volume with four widget onclick actions to setup the volume to four predefined values - 0%, 30%, 60%, 100%.
It seems to be logically to call a flow "Set Sound Level" and just pass a single value but it is not possible now. Am I missing something?


Regards,

Alex

guuzendesu
Posts: 62
Joined: 15 Jan 2014 08:25

Re: Pass parameters with a flow

Post by guuzendesu » 14 May 2014 02:32

I had a little problem with this too. What he suggested to me was to use "Restore Audio Volumes" after setting a variable to the desired level, and using that value in the "Restore" function.
If you're getting the value from voice input, be sure to turn a possible "text number" into an actual number with "toNumber(variable)".

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

Re: Pass parameters with a flow

Post by Martin » 14 May 2014 18:34

Hi,

The next version of Automagic passes additional variables containing the column and row of the clicked action to the flow. widget_cell_x contains the column, widget_cell_y contains the row.
You could use a condition like Expression: widget_cell_x==0 to execute actions conditionally or you could use an action Script to map the cell to a value like 0, 30, 60 or 100.

Regards,
Martin

Locked