Page 1 of 1

Pass parameters with a flow

Posted: 13 May 2014 22:53
by ZSasha
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

Re: Pass parameters with a flow

Posted: 14 May 2014 02:32
by guuzendesu
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)".

Re: Pass parameters with a flow

Posted: 14 May 2014 18:34
by Martin
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