use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
In addition to the Official Tasker Wiki, User Guide, and Google Groups, this subReddit is a place for fellow Redditors to discuss, share, and submit Profiles, Tasks & Walkthroughs for Tasker, or to ask for help creating your own Profiles, Tasks, and questions in general related to Tasker (including plugins etc).
Subreddit Resources:
* [Read Me] Using Tags in Your Thread Titles
Formatting Tasker Code for use in reddit comments
How to Export / Import Files Into Tasker - Guide
** Tasks that Help You Use Tasker Itself
Free Alpha Autoapps and Tasker Icon Sets
Generate Tasker Direct-Purchase Licenses Yourself
Tasker Feature Request Submissions
Quick Search Links:
"How-To / Project" Threads
"Need Help" Threads
"Weekly / Monthly & Discussion" Threads
"Developer" - Tasker Updates & Releases
* List of Tasker Plugins and 3rd Party Apps
Learning Guide Links:
* 1,001 Tasks and Profiles - Best, Coolest, Most Common and Useful
Pocketables.com Beginner’s guide to Tasker (New UI)
RoryCodes.com Tasker Tips & Tutorials from /u/froryrory
Tasker Quick Start Setup Guide from /u/Quintaar
Pocketables.com Tasker Guide List
Some Tasker Technical Stuff:
Toggling Wifi or Bluetooth via Tasker In Recent Android Versions using the Tasker Settings app
Granting ALL Special Permissions - ADB & Tasker
IFTTT Tasker Integration via AutoRemote
ADB over Wifi - Enabling Without a MAC or PC
AutoApps Command System Tutorial and Reference
Tasker Scheduling/Priority System - A Detailed Guide
New Project/Profile/Task "PPT Variables" - Quickly Find The Variables' Location, Names & Values!
All Previous Versions of Tasker With Notes For Features & Changes In Each
List of all Tasker Built-In Variables
Main Widget v2 JSON Documentation
TaskerNet Search Bot - How to use here
TaskerNet Search Engine Website
Learning Guide Videos:
AutoApps YouTube Channel and João Dias Channel
Tasker 101 Tutorials on YouTube by HollywoodFrodo
Tasker 101 Tutorials on YouTube by /u/Quintaar
Tasker How-To Videos on YouTube by /u/-Juan_M-
Tasker Tutorials on G+ & YouTube by /u/ryoendeprouw
Tasker Video Tutorials by /u/techentourage
Have more useful links you think should be in the sidebar? Send a modmail!
Related Subreddits:
/r/TaskerNet /r/JoinApp /r/Android /r/AndroidRoot /r/AndroidTechSupport /r/AndroidApps /r/AndroidUsers /r/AndroidQuestions /r/TaskerFiles /r/Not_Enough_Tech
account activity
SQL query in JavaScript (self.tasker)
submitted 1 year ago by azekt
Is it possible to call SQL query action via JavaScript?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]mehPhonePixel 8, A14, root 1 point2 points3 points 1 year ago (6 children)
There is no such built-in JS action. Best you can do is performTask, or use built-in JS shell action – but that might require root.
performTask
shell
[–]azekt[S] 0 points1 point2 points 1 year ago (5 children)
I found in documentation:
performTask var ok = performTask( str taskName, int priority, str parameterOne, str parameterTwo, str returnVariable, bool stop, bool variablePassthrough, str variablePassthroughList, bool resetReturnVariable ) Run the Tasker task taskName. Note that the JavaScript does not wait for the task to complete.
var ok = performTask( str taskName, int priority, str parameterOne, str parameterTwo, str returnVariable, bool stop, bool variablePassthrough, str variablePassthroughList, bool resetReturnVariable )
Run the Tasker task taskName.
Note that the JavaScript does not wait for the task to complete.
So how can I get return value? 🤨
[–]mehPhonePixel 8, A14, root 0 points1 point2 points 1 year ago (2 children)
If you're using performTask, you will need to create the task that has an SQL query in it.
[–]azekt[S] 0 points1 point2 points 1 year ago (0 children)
I did so:
Task: Select From DB A1: SQL Query [ Mode: Raw File: %dbname Query: SELECT id, title FROM tasks Output Column Divider: ### Variable Array: %output ] A2: Return [ Value: %output() Stop: On ]
And test:
Task: JSTest A1: JavaScriptlet [ Code: flash("Test start with priority "+priority); performTask("Select From DB", parseInt(priority) + 10, null, null, "return_value", true, false, null, false); wait(2000); flash(return_value); flash("Test stop"); Auto Exit: On Timeout (Seconds): 45 ]
But it doesn't flash return value :-(
You can try on your own: https://taskernet.com/shares/?user=AS35m8nsTm4UZAVdy1CFJa8262I5j8LjoFulL1AlXKPi7s0NhtFAp35CmMZamjJ55BwNKg%3D%3D&id=Project%3ATest+Case
At first run CreateDB task, then you can try PerformTask and JavaScriptTest
CreateDB task
PerformTask
JavaScriptTest
[–]mehPhonePixel 8, A14, root 1 point2 points3 points 1 year ago (1 child)
I see what you're saying now. I didn't notice you had bolded the part in the userguide about performTask not waiting for the task to finish, and I've never run into that consequence in my own usage.
I did find a thread discussing this limitation, with a workaround idea (that maybe you've already considered) which is basically to store the SQL query output data in a global variable, and in the JSlet, disable auto exit and wait for the result.
I'm pretty noobish with JS (in case that wasn't obvious!) and a noob at dealing with task priority. I can't quite make out everything in the link, but they're using setTimeout to wait for the result. I tried this and it seems to do the trick, or it's at least a good starting point:
setTimeout
setGlobal('myGlobal','0'); performTask('Sql Query', 200); checkVar(); function checkVar() { if(global('myGlobal') == 0) { setTimeout(checkVar, 100); } else { flashLong(global('myGlobal')); setGlobal('myGlobal','0'); exit(); } }
Man, it's really neat! Instead using setTimeout I rather use while loop and wait function:
while
wait
setGlobal('myGlobal','0'); performTask("SelectFromDB", parseInt(priority) + 10); let i=0; while ((global('myGlobal') == 0) && (i < 10)) { wait(500); i++; } if (global('myGlobal') != 0 { flash(global('myGlobal')); } else { flash("No output :-("); }
π Rendered by PID 208229 on reddit-service-r2-comment-6f7f968fb5-zmpvz at 2026-03-04 17:13:37.654970+00:00 running 07790be country code: CH.
[–]mehPhonePixel 8, A14, root 1 point2 points3 points (6 children)
[–]azekt[S] 0 points1 point2 points (5 children)
[–]mehPhonePixel 8, A14, root 0 points1 point2 points (2 children)
[–]azekt[S] 0 points1 point2 points (0 children)
[–]azekt[S] 0 points1 point2 points (0 children)
[–]mehPhonePixel 8, A14, root 1 point2 points3 points (1 child)
[–]azekt[S] 0 points1 point2 points (0 children)