Variable not supporting in Execute Flows Action

Post your questions and help other users.

Moderator: Martin

Post Reply
MohitBariya
Posts: 15
Joined: 28 Apr 2017 15:29

Variable not supporting in Execute Flows Action

Post by MohitBariya » 06 Aug 2017 17:17

Variable is not supporting in Execute Flows Action.

Screenshot_20170806-224401.png
Screenshot_20170806-224401.png (120.79 KiB) Viewed 13143 times

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Variable not supporting in Execute Flows Action

Post by Desmanto » 07 Aug 2017 06:13

It has been requested already. The workaround for now is you can replace that execute flow with Action Script, contains single line to set global variable. It can be single value or list. Example, if you have 3 variables :
global_parameter = newList("on", 123, "replace")

Then in the flow you wanna execute, add new trigger Global Variable, point to this global_parameter. To access the variable, use global_parameter[0], global_parameter[1] and global_parameter[2].

The disadvantage for the parameter more than 1 (just like above) is you have to change the value of all element in single line to trigger the GloVar. If one of the element still has the same value, the flow won't get triggered. So you might need to add an additional script at the end of the flow, to change each element to something else.

The other way around is to use Action Send broadcast, paired with Trigger General broadcast. It is more difficult, but doesn't need GloVar nor the limitation.
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.

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

Re: Variable not supporting in Execute Flows Action

Post by Martin » 07 Aug 2017 19:11

Hi,

I don't understand the first post since the action does support replacing variables. {value} is also displayed in blue so it should work.
Can you please share a simple flow where the feature does not work or elaborate what you want to achieve exactly?

Thanks & Regards,
Martin

MohitBariya
Posts: 15
Joined: 28 Apr 2017 15:29

Re: Variable not supporting in Execute Flows Action

Post by MohitBariya » 08 Aug 2017 07:36

I am unable to upload flow file. Forum showing me error "My upload was rejected because file was identified as attacked vector."


Regarding my flow, I want to create a flow which is having list of shortcut. And it triggers respective flow/shortcut.

I found two problem.
First is, launch/create shortcut action only allows dropdown list of shortcut. No variable allowed. So i looked another work around.
Prepared list with flow which are named same as shortcut and trigger flow.
But action Execute Flow also not supporting with variable.
It is giving error "flow not found" in log.

Please help me.

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: Variable not supporting in Execute Flows Action

Post by Desmanto » 08 Aug 2017 13:15

Sorry, it seems I misunderstood your question before.

Launch app can handle variable. Just tested it with script.
cal = "com.android.calendar"

Then in the Launch app, fill in {cal} for the package name, with default activity. It launchs the calendar. Of course, we should execute the whole flow, so the script get executed as well, not just only that Launch app.

Execute Flow also the same. Try create variable
list = "Test"
Then at the Execute flow, fill in {list} for the flow. It execute the flow Test.

Remember the name is case sensitive. If the flow name is "test", then it will produce error. The easiest way is to pick up the flow from the choice and the copy the full name and paste it in the script which set the list of the flows. For multiple flow execution, there must no space between flow. So "Test,Tester" will execute flow Test and Tester. But "Test, Tester" (has additional space after comma), will result in error.
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.

Post Reply