Page 1 of 1
"trigger" variable
Posted: 22 Oct 2017 14:54
by digitalstone
When evaluating the "trigger" variable inside a flow by triggering it manually it results in "Manual".
When evaluating the "trigger" variable inside a flow by triggering it by a widget, a screen testing screen-notification shows "widget Click"... yet the expression evaluates it as "Manual".
Not sure if this is a bug because i think i can see how this happens, but i think it is too unpractical.
Re: "trigger" variable
Posted: 22 Oct 2017 16:35
by Desmanto
What elements do you use to check it? Probably you assign value "Manual" to the {trigger} by using single equal sign. In Automagic,
trigger = "Manual"
is different with
trigger == "Manual"
Single equal sign (=) is to assign value, while double equal sign (==) is to check the value and return true or false.
I have expression to check for widget click in several flows, and it never fail me to be evaluated as "Manual".
Re: "trigger" variable
Posted: 22 Oct 2017 17:59
by digitalstone
Desmanto wrote:What elements do you use to check it? Probably you assign value "Manual" to the {trigger} by using single equal sign. In Automagic,
trigger = "Manual"
is different with
trigger == "Manual"
Single equal sign (=) is to assign value, while double equal sign (==) is to check the value and return true or false.
I have expression to check for widget click in several flows, and it never fail me to be evaluated as "Manual".
I use my expression with double equal sign (==) to ensure to compare the values rather than assign a value.
What i use is simply:
Expression# 1: if (startsWith(trigger, "Manual") {return true} else return false; ....etc
Expression# 2: if (startsWith(trigger, "Widget") {return true) else return false; .....etc
Whether i execute the flow manually or by using the widget, it never reach Expression#2.
Re: "trigger" variable
Posted: 23 Oct 2017 01:22
by Desmanto
It is too long. You can check the trigger just by the ==.
Expression 1 :
in parallel with Expression 2 :
Both expression will return true or false depends on the result of evaluation.
Try to add condition Debug Dialog to expression 1 to see the value of the trigger.
You can check my index why we should use parallel, search for "Multiple Choice".
Re: "trigger" variable
Posted: 24 Oct 2017 08:54
by digitalstone
Thanks Desmanto
I should have linked the expressions parallel instead of serial to look at both values.
I kind of got away from that method because i saw an aweful lot of re-doing actions when parallel linking. I think i know why too now.