Export flow with variable as target

General discussions about Automagic and automation in general

Moderators: MURTUMA, Martin

Posts: 11
Joined: 05 Dec 2018 16:14

Export flow with variable as target

Postby yxd0018 » 12 Jan 2019 01:00

Hi, I have difficulty to export flow with variable as target. Hard-coded string works though. The docs say it support variable.

User avatar
Posts: 1400
Joined: 21 Jul 2017 18:50

Re: Export flow with variable as target

Postby Desmanto » 12 Jan 2019 12:18

I try the variable and it is working fine. Probably your variable path is not valid. Try to check it using condition debug dialog.

Action : Script
Code: Select all
file = "/storage/emulated/0/Automagic/a.xml"

Condition : Debug Dialog
True, goto
Action : Export Flows/Widgets
Flow pattern list : pick your flow
Target File : {file}

Run the flow and check the {file} value in the debug dialog, to make sure it is valid. You can check yours too.
Index of Automagic useful thread List of my other useful posts (and others')

Posts: 11
Joined: 05 Dec 2018 16:14

Re: Export flow with variable as target

Postby yxd0018 » 12 Jan 2019 13:48

I found the cause. Thanks, debug dialogue is very good. I wish someday I can run some pure language, like python or Java/JavaScript inside.

User avatar
Posts: 1400
Joined: 21 Jul 2017 18:50

Re: Export flow with variable as target

Postby Desmanto » 12 Jan 2019 18:34

After last week diving deep trying to decipher some javascript, so I can mimic the HTTP post in Automagic; I would say running pure python/javascript language seems unlikely. Because those 2 are OOP, while Automagic scripting isn't. I am trying to create function using eval() and that already takes a lot of try and error to make it work.
Index of Automagic useful thread List of my other useful posts (and others')

Posts: 11
Joined: 05 Dec 2018 16:14

Re: Export flow with variable as target

Postby yxd0018 » 14 Jan 2019 19:57

Thanks, is there a page to list all built-in variables? I try to use connected wifi condition. even I defined global var as list, but the condition doesn't get satisfied. The help page doesn't say much how to get connected ssid name out.

User avatar
Posts: 1400
Joined: 21 Jul 2017 18:50

Re: Export flow with variable as target

Postby Desmanto » 15 Jan 2019 18:28

You mean to list all the variables names or the variable's values? Example, {ssid} or do you mean the wifi name? (hotspot1, office_1st, google_wifi).

To list all available but not used variable, simply tap the 3 dot menu at any element editing, Select variable and uncheck only available. By default, this is checked and only show available variable until this point of the flow.
To check the value, use debug dialog, that is the best way. But sometimes debug dialog is not practical for quick and unattended flow, that's why I made my variable logger flow : viewtopic.php?f=3&t=7285

While for certain menu, you can select any default or exisiting value. For example, wifi connected trigger, you can uncheck "all" and tap the ellipsis to pick any of the connected wifi in the past.
Index of Automagic useful thread List of my other useful posts (and others')

Return to General

Who is online

Users browsing this forum: No registered users and 7 guests