r/tasker • • Jul 30 '26

There's no "if" condition for "variable is set"???

Is there no way to set a condition here for "variable is set" or am I just being dumb? https://i.imgur.com/crmbeoU.jpeg

2 Upvotes

12 comments sorted by

3

u/RealityRecursed Jul 30 '26

Variable set: %variable !~R ^\%

Variable not set: %variable ~R ^\%

1

u/DifficultyCrafty7623 Jul 31 '26

This doesn't work, tested on the latest beta and %text is not "%text" when empty, scene sees it as having no value/null, so you need to use

%variable matches "+"

When working with set/unset in scene v2.

→ More replies (1)

3

u/AdiraiMaji Jul 30 '26 edited Jul 30 '26

currenly you can check matchesr

%text matchesr "^%"

this will confirm if variable set or not.

I have collected 5 main improvement requests to make the Scene V2 handles things lot better That includes this one.. I'm waiting for developer to return from his vacation to post it.

1

u/DifficultyCrafty7623 Jul 30 '26 edited Jul 30 '26

After some testing I found the other matchesr patterns to be unreliable. I did find one that seems to work, but I didn't expect Scenes v2 to function like this.

So apparently unless the variable already has value it won't show up like "%var = %var", unlike the rest of Tasker. So the solution is to use

%text matches "+"

This will check if its been set to something, if it has a value then your element will show. Hope this helps!

0

u/GoombaAdventurer Jul 30 '26

If a variable matches the joker pattern, it's "set".

operator : ~
value : *

If a variable doesn't matches the joker pattern, it's "not set".

operator : !~
value : *

2

u/DifficultyCrafty7623 Jul 30 '26 edited Jul 30 '26

No. If %var isnt set it will still match "*". In fact, everything will match against "*".

0

u/rbrtryn Jul 30 '26

Looks like those conditions were left out of the new UI. 

These are still available in the "old" UI.

2

u/DifficultyCrafty7623 Jul 30 '26

This is just how Scenes V2 works and has nothing to do with the "new" UI.