Page 1 of 1

click and other actions on widget

Posted: 28 Jan 2020 16:07
by tsolignani
Good afternoon everyone.

I know i can have a clickable element on a widget which does a thing if, say, clicked, and another one if double, or long, clicked.

Is there a way I can get to know if that widget has been clicked once, twice, double clicked and so on?

That way I could have a single flow perform a task slightly different according to the way the clickable element has been tapped.

For instance, I can have a flow make reply to a mail if clicked once or reply all if double clicked.

Thank you, this is a great community indeed!

Re: click and other actions on widget

Posted: 28 Jan 2020 19:13
by Desmanto
Yes, check the {gesture} variable. This var only available when the flow is triggered by widget action. Look at this similar topic about combining multiple widget action block into single flow : viewtopic.php?f=4&t=8525

gesture can have 7 values :
CLICK
LONG_CLICK
DOUBLE_CLICK
SWIPE_UP
SWIPE_DOWN
SWIPE_RIGHT
SWIPE_LEFT

You can also check {widget_cell_x} and {widget_cell_y} to find out which block is the source of action. Look at the link above for example how I implemented it. It is much easier to use a map to map each action first, before branching them accordingly using multiple parallel expression.