I have a flow which has multiple triggers. Most of these are "when connected to <car> by bluetooth", but I also have a home screen Shortcut which can I use.
I want to do slightly different things within the flow depending on how it was triggered ("if it was car1, do this, but if it was car2, do something else") and that's easy.
What I can't figure out is how to determine if the flow was triggered by the Shortcut.
Is this possible, and if so how? (I could duplicate the flow, or possibly change the Shortcut to a Widget, but they both feel like rather inelegant solutions).
Many thanks.
How to tell is flow was triggered by a Shortcut?
Moderator: Martin
Re: How to tell is flow was triggered by a Shortcut?
You can use expression after the trigger to check and branch the flow accordingly. Example, i have 11 time triggers at my office announcer flow. I split the branch by checking what is the name of the trigger, using condition expression. One of them is
To get the trigger name, just edit the trigger and copy the name from there. Remember to quote it at the expression.
Create several parallel expression to check the incoming trigger. You can check example in my index, flow sharing - navigation flow. I split the triggers using the same concept. For reason why parallel than series, check the "multiple choices" thread.
Code: Select all
trigger == "Time: Sat 12:00"
Create several parallel expression to check the incoming trigger. You can check example in my index, flow sharing - navigation flow. I split the triggers using the same concept. For reason why parallel than series, check the "multiple choices" thread.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.