Variable input for flows.

Post your questions and help other users.

Moderator: Martin

Post Reply
itmam4a
Posts: 1
Joined: 25 Dec 2015 13:33

Variable input for flows.

Post by itmam4a » 25 Dec 2015 13:50

Hi,

I'm a long time Tasker user but switched to Automagic this week because it slightly more accurate and a lot more intuitive. However do have a small thing I haven't been able to figure out just yet.

Basically I have created a Custom Widget to act as a message dashboard/car ui.

The widget has 8 clickable area's and based on what area I click I send out a different message.
- "I'm leaving"
- "I'm stuck in traffic"
that kind of stuff.

Currently I have 8 flows; one for each clickable area but the only difference is the message text. So what I would like is one flow with a variable as input and set the variable based on the clicked area.

I'm probably missing something very obvious here but I can't find how to do this. Any advice on this?

Mark

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

Re: Variable input for flows.

Post by Martin » 29 Dec 2015 20:19

Hi,

Automagic passes some variables to the flow about the clickable cell when a flow is executed by a widget clickable action.
Variables of interest might be widget_cell_x, widget_cell_y. I recommend to create a flow with one condition Debug Dialog and execute this flow for the click so you can see the actual provided variables and values.

You could build one flow that uses an action Script to get the text depending on cell coordinate.

Something like this might work (untested):
map = newMap();
addMapEntry(map, "0/0", "text 1");
addMapEntry(map, "0/1", "text 2");
addMapEntry(map, "0/2", "text 3");

text = getMapValue(map, widget_cell_x + "/" + widget_cell_y);

Regards,
Martin

Post Reply