AutoNotification AutoNotification can't use all variables passed from other task

Discussion in 'AutoApps' started by yannick.rc, Jun 7, 2018.

  1. yannick.rc

    yannick.rc New Member

    Joined:
    Apr 7, 2018
    Messages:
    23
    Likes Received:
    0
    Hey guys,

    I'm trying to pass variables between tasks and have them work in autoNotification. For the last few days, I've tried different ways of doing this, none fully successful.

    The variables come across, but when I use them to create a new custom autoNotification, it looks like only %antitle and %antext are working in the notification. Any buttons or icons don't show up in the new custom autoNotification. If I add an autoNotifcationQuery in the variable receiving task it works, so the autoNotification seems to be set up correctly.

    My current best setup is as follows (simplified for demonstration purposes):

    TaskA: Gets all the needed AutoNotificationQuery variables and depending on certain criteria passes them to a specific next task with %par1,%par2. This is how it passes them on:

    Code (Text):
    A5: Perform Task [
    Name:TaskB
    Priority:%priority
    Parameter 1 (%par1):%anid, %antitle, %anstatusbaricon, etc...
    Parameter 2 (%par2):anid, antitle, anstatusbaricon, etc...
    Return Value Variable: Stop:Off ]
    TaskB: Creates a new notification based on the variables from TaskA, which it receives using AutoToolsText, like so:

    Code (Text):
    A2: AutoTools Text [ Configuration:
    Text: %par1
    Variable Name: %par2
    Joiner Variable: atjoinedtext
    Separator: , Timeout (Seconds):60 ]
    If I use the variables without brackets in TaskA's Perform Task Action (i.e. %anid instead of %anid()), I can flash them correctly in TaskB, however the only ones that seem to get picked up are %antitle and %antext.

    I've run out of ideas of how to fix this. Any ideas what might be going on?

    thank you!

    Yannick
     
  2. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    In the AutoTools Text action set Variable Name to par2 without the % :)
     
  3. yannick.rc

    yannick.rc New Member

    Joined:
    Apr 7, 2018
    Messages:
    23
    Likes Received:
    0
    Hi Joao,

    Thanks for the quick reply. I just tried it, but unfortunately now AutoTools errors and no variables are coming through. :s

    I'm getting the following error :
    If I use %par2, I get variables coming through, so I guess the number of variables must to be the same.

    That's strange. Is this what you meant for my new PartB?
    Code (Text):
    A2: AutoTools Text [ Configuration:
    Text: %par1
    Variable Name: par2
    Joiner Variable: atjoinedtext
    Separator: , Timeout (Seconds):60 ]
    Thank you!

    Yannick
     
  4. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    Oh sorry, I totally misread your original question :)

    I'm not sure I understand the issue though. Can you post an example of an that's not working for you? You only posted the one that works. Thanks!
     
  5. yannick.rc

    yannick.rc New Member

    Joined:
    Apr 7, 2018
    Messages:
    23
    Likes Received:
    0
    Hey Joao,

    no worries at all. :) The issue is that I can transfer certain variables between tasks, (when not using brackets), but they don't all work in the custom autoNotification.

    Here is a full example of that...

    TaskA:

    Code (Text):
    Test (39)
        A1: AutoNotification Query [ Configuration:Notification Apps: Google Timeout (Seconds):20 ]
        A2: Perform Task [ Name:ReceiveTaskVars Priority:%priority Parameter 1 (%par1):%anid, %antitle, %antitlebig, %antext, %antextbig, %anicon, %anbigicon, %anstatusbaricon, %anbutton1text, %anbutton1icon, %anbutton1action, %anbutton2text, %anbutton2action, %anbutton2icon, %anbutton3text, %anbutton3action, %anbutton3icon, %anbutton4action, %anbutton4text, %anbutton4text, %anbutton5action, %anbutton5text, %anbutton5text, %antouchaction, %ancolor, %anstatusbaricon Parameter 2 (%par2):anid, antitle, antitlebig, antext, antextbig, anicon, anbigicon, anstatusbaricon, anbutton1text, anbutton1icon, anbutton1action, anbutton2text, anbutton2action, anbutton2icon, anbutton3text, anbutton3action, anbutton3icon, anbutton4action, anbutton4text, anbutton4text, anbutton5action, anbutton5text, anbutton5text, antouchaction, ancolor, anstatusbaricon Return Value Variable: Stop:Off ]
    And the receiving TaskB:

    Code (Text):
    ReceiveTaskVars (18)
        A1: AutoTools Text [ Configuration:Text: %par1
    Variable Name: %par2
    Joiner Variable: atjoinedtext
    Separator: , Timeout (Seconds):60 ]
        A2: Flash [ Text:%anid, %antitle, %antitlebig, %antext, %antextbig, %anicon, %anbigicon, %anstatusbaricon, %anbutton1text, %anbutton1icon, %anbutton1action, %anbutton2text, %anbutton2action, %anbutton2icon, %anbutton3text, %anbutton3action, %anbutton3icon, %anbutton4action, %anbutton4text, %anbutton4text, %anbutton5action, %anbutton5text, %anbutton5text, %antouchaction, %ancolor, %anstatusbaricon Long:Off ]
        A3: Variable Randomize [ Name:%notifId Min:0 Max:9999 ]
        A4: AutoNotification [ Configuration:Title: %antitle
    Text: %antext
    Action on Touch: notif_action %notifId=:=%antouchaction
    Icon: %anicon
    Status Bar Icon Manual: %anstatusbaricon
    Background Color: %ancolor
    Id: %notifId
    Dismiss on Touch: true
    Priority: 1
    Title Expanded: %antitlebig
    Text Expanded: %antextbig
    Action Icon 1 Manual:
    Icon 2: ic_launcher
    Icon 3: ic_launcher
    Icon 4: ic_launcher Timeout (Seconds):20 ]
    Together these are able to transfer the variables, but unable to use them in a custom autoNotification,

    Thanks!

    Yannick
     
  6. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    Hmm, but the variables show up in Tasker if you flash them? If they work in Tasker they should work in AutoNotification as well...
     
  7. yannick.rc

    yannick.rc New Member

    Joined:
    Apr 7, 2018
    Messages:
    23
    Likes Received:
    0
    Hi Joao!

    Thanks for the reply. It helped a lot, as I've been looking at this differently now, knowing that it should be working as is. I finally found what is going wrong!

    1. I had spaces in my variable lists.

    My lists had variables like this %antitle, %antext, etc... and antitle, antext, etc.... Since my separator was ',' it was keeping a space after every variable created with AutoToolsText. Removing the spaces or using the trim option worked.

    2. My %antitle and %antext values sometimes included commas.

    Since some notifications have commas in the %antitle or %antext values autoToolsText seemed to be further splitting my variables, resulting in the aforementioned error of the number of texts not matching the number of variables. Using a more unique separator worked to fix this.

    It finally works. Thank for your help and have a good day! :)

    Yannick
     
  8. joaomgcd

    joaomgcd Administrator Staff Member

    Joined:
    Feb 3, 2015
    Messages:
    9,477
    Likes Received:
    806
    Awesome :D Glad you got it!!
     

Share This Page