Notify Action - getting the return value from Perform Task Action

91 views
Skip to first unread message

francwalter

unread,
Aug 23, 2019, 4:25:54 AM8/23/19
to Tasker
Hallo

I try to get the return value from a Task, which I run via a Perform Task Action in a Notify Action, but this doesn't work.

I have a Task, with a Notify Action.
In that Notify I have another Action, the Perform Task Action (I have set a variable into the Return field).
That child Task opens a scene where I input some text, which is returned to the child Task.
The child Task does a Return Action and should give back the return variable to the parent Task (which is the main Task with the Notify).

But in the main Task the return variable is never set.

Is this by design, that it doesn't work?
I read in the help about Notify "... Actions do not run as part of the notifying task." - does that mean I cannot use at any means the Return variable (and Return Action)?

Thanks for clarification.

frank

Tasker 5.8.3 on Xiaomi Mi A1 with 9.0 (rooted)


Marta Hintz

unread,
Aug 24, 2019, 2:56:18 PM8/24/19
to Tasker
that should work. post your exported description here, not xml, to see if you are doing it correctly.

the help files also states that value will not be returned if the Perform Task is the last action of the parent.

also do you have a stop action in your perform action or have the correct priority set in the parent task? sometimes the value had to be set before you finish the patent task.

francwalter

unread,
Aug 28, 2019, 2:11:03 PM8/28/19
to Tasker
zTestNotifyTaskReturn (404)
A1: Notify [ Title:Test Text: Icon:mw_editor_title Number:0 Permanent:On Priority:3 Repeat Alert:Off LED Colour:Yellow LED Rate:0 Sound File: Vibration Pattern: Category:Timer Actions:(1) ]
A2: Wait Until [ MS:0 Seconds:3 Minutes:0 Hours:0 Days:0 ] If [ %return Set ]
A3: Popup [ Title:zTestNotifyTaskReturn Text:%return Background Image: Layout:Popup Timeout (Seconds):15 Show Over Keyguard:Off ]
A4: Notify Cancel [ Title: Warn Not Exist:Off ]


zTestReturn (390)
A1: Status Bar [ Set:Collapsed ]
A2: Flash [ Text:zTestReturn Long:Off ]
A3: Return [ Value:zTestReturn: Return Stop:On ]

Here are two tasks to test that.
I tap the button in the notify but nothing happens, the return value is never set in the parent task (where the notify is fired)

In this setting the notify would never disappear because the Wait Until Action waits for return value to be set.

I guess that there is no connection between the first task and the second task because the second task is only started through a notify action.
Could that be?

francwalter

unread,
Aug 28, 2019, 2:14:09 PM8/28/19
to Tasker
... And as i see how, in the description is totally missing the perform task action in the notify action.
So either the description export is buggy/incomplete or i am doing something wrong.

francwalter

unread,
Aug 28, 2019, 2:31:35 PM8/28/19
to Tasker
My only idea to solve this issue is a dirty one with global variables.

But since a while i try to avoid to use these like that and to use global variables only for settings.

Robert Ryan

unread,
Aug 28, 2019, 3:31:58 PM8/28/19
to tas...@googlegroups.com
"So either the description export is buggy/incomplete" 

The description is incomplete. The actions run from the Notify buttons are not included in the description. This is also the case for tasks run from scene elements. I believe that there is an open bug report about this, but I can't seem to find it. 

---------------------------
" the return value is never set in the parent task (where the notify is fired)" 

Correct, the last sentence in the help text for the Notify action states: "Actions do not run as part of the notifying task.". Therefore the return value is not returned to the notifying task. 

----------------------------
"But since a while i try to avoid to use these like that and to use global variables only for settings." 

I would advise not limiting yourself. Globals certainly should not be overused, but in this case they may be the best option. 


francwalter

unread,
Aug 28, 2019, 4:25:45 PM8/28/19
to Tasker
Am Mittwoch, 28. August 2019 21:31:58 UTC+2 schrieb Robert Ryan:
> ...
> I would advise not limiting yourself. Globals certainly should not be overused, but in this case they may be the best option. 

OK then, i did it with a global variable, which was really very easy and fast. Especially when i compare it with all my efforts to try to do it as above.

Thank you!

Reply all
Reply to author
Forward
0 new messages