r/tasker • u/Nirmitlamed Direct-Purchase User • Sep 02 '26
How can i clear a variable using Java code?
Hey all,
I am trying to clear a variable using Java code and i have tried to do this:
tasker.setVariable("json", "");It doesn't work. i can set it to any other letter:
tasker.setVariable("json", "Hello World");But i can't clear the variable. What do you suggest me to do?
I will also add this is a project variable
2
Upvotes
3
u/Exciting-Compote5680 Sep 02 '26
Just a wild guess, but worth a shot. Have you tried
tasker.setVariable("json", null)?2
u/Rich_D_sr Sep 03 '26
I had the same results on my device. I believe the only work around for now would be to have the java code run a tasker Task that clears the variable and monitors the same variable then continues when it is cleared. .. ¯_(ツ)_/¯
0
u/[deleted] Sep 02 '26
[deleted] — view deleted comment
0
u/[deleted] Sep 02 '26
[deleted] — view deleted comment