How to automatically create transactions using Tasker, AutoWeb and YNAB.

This post should help get you started on creating transactions using Tasker on your Android phone.

I will do my best to help if you get stuck!

It is a long post because of the size of the screenshots (I couldn't figure out how to reduce the size of them in the post).

  1. Get your personal access token as described here - copy it as you will need it later! https://api.youneedabudget.com/#personal-access-tokens
  2. Go here https://joaoapps.com/autoweb/ to set up AutoWeb - follow the instructions.
  3. In AutoWeb click "Browse Web Services".
  4. Search by typing in YNAB.
  5. Long press on YNAB and click "Import API".
  6. Go back to AutoWeb home page, select "Your Web Services".
  7. Long press on "YNAB".
  8. Click on "Edit API Config".
  9. Scroll down to "Secret Key Specific".
  10. Delete whatever is in the "Secret Key" field and paste your personal access token from step 1 here.
  11. Tap OK - you are now ready to start adding automated transactions!
  12. Go to YNAB on your computer browser and visit the budget and account you are interested in.
  13. Now look at the URL:
  14. Copy and paste the numbers and letters between the first two forward slashes - this is the budget ID.
  15. Copy and paste the numbers and letters between the second two forward slashes - this is the account ID.
  16. In Tasker, create a new Task.
  17. Add a new action and select "Plugin", "AutoWeb" and then "Web Service".
  18. Click the pencil icon to configure the action.
  19. Click API, select YNAB.
  20. Click API action (will not be greyed out) and select "Create New Transaction".
  21. You will need to copy your account ID from step 21 and paste it into "Account ID".
  22. Scroll to the bottom and paste your budget ID from step 20 into "Budget ID".
  23. Set up some initial values for testing, such as Date, Amount, Payee Name etc.
  24. Next, click "Output" and select all.
  25. When finished, click the tick icon to save.
  26. You will see the action configuration - check to make sure it looks OK, then click back.
  27. Run the task with the "play" button.
  28. If all goes well, you will see a green dot and no error messages.
  29. Now check your budget in YNAB - the new transaction should be there.
  30. This should be enough to get you going - now you can personalise the "create transaction" action to how you want to use it. I'll be adding a trigger to this action to capture amount (make it negative for outgoing e.g. -1000), date and payee of my Google Pay notifications.
57replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi rownie23 !

    Thank you for sharing and being so detailed with the instructions! :)

    Like 1
  • rownie23 ,

    Thanks for this.  I was able to get this working and get a transaction to enter into YNAB.  I am new to tasker and the api and so I have a couple of questions that I am hoping that you can answer.

    1.  When performing the test there is a dummy payee and amount that is entered.  Will that get automatically overridden when a transaction comes across, or does it need to get replaced with a variable so it pull the name and amount from Google Pay?

    2. How exactly does one actually link the google pay app so that info is passed?  I did create a profile using Google Pay/App services and pinted it to the task that I created.  Is that correct?

    I hope that you are able to answer these questions for me as I have been hoping to have Google pay auto enter transactions for me.

     

    Thanks

    Like
  • This is the second half of the post (sorry I couldn't edit the first post to include it there).

    Now that your task can successfully add a dummy transaction, we need to use it to import actual transactions from Google Pay into YNAB. To do this you will need to install another Tasker plugin called AutoNotification. The plugin is safe, it os developed by the same guy who develops Tasker and AutoWeb.

    Once you have that installed and activated, we can get started. Note that the way I run through this uses an existing notification from Google Pay, but that isn't necessary. It does make it a bit easier though.

    1. Go to the profiles and add a new profile - select "Event" as the trigger.
    2.  
    3. Next, select plugin, AutoNotification and then "Intercept".
    4. Next, tap the pencil to edit the configuration.
    5.   
    6. Tap "Fill From Current".
    7.  
    8. Select the notification - the payee should be listed to help you identify it.
    9. Next select the options as shown. This gets the information from the Google Pay notification to pass into YNAB.
    10. Tap the check at the top of the screen to save the configuration. It should look like this:
    11. When you tap the back button, you will be prompted to link the profile to a task. Select the dummy transaction task you created previously.
    12. Now we need to do some manipulation of the data grabbed from the notification to parse it correctly. Namely the amount needs to be     negative as it is a debit and multiplied by 1000 to match YNAB format (miss this out and you will be over-budgeted very quickly!) Also, the date from Tasker needs to be reversed to match YNAB formatting, so we use an array to do that.
    13. Here is the complete task:
    14. For action number 1, the splitter used is left blank. If you have any issues, try a space. Just press the spacebar once, don't use quotes.
    15. For action 2, use the symbol for your native currency i.e. USA = $.
    16. For action 3, ensure you check the box marked "Do Maths".
    17. For action 5, use a hyphen as the splitter.
    18. Your last action should be the one using AutoWeb, so you will nee d to make sure you rearrange the tasks to suit.
    19. In the last action using AutoWeb, you will need to make the following changes:
    20. Date: set to "%ynabdatearr"  (no quotes).
    21. Amount: set to  "%amount" (no quotes).
    22. Payee name: set to "%antitle"   (no quotes)
    23. You can change the memo field to be blank, or leave as "from Tasker" as a reminder when you view in YNAB.
    24. I haven't experimented with the "Approved" field yet. I imagine setting that to "Approved" would make the transaction be approved in YNAB, but for the meantime I want it off so YNAB alerts me that there is something to check.
    25. Likewise, you could give the Tasker generated transaction a flag colour or mark it as cleared if you like.
    Like
      • Hal Sitt
      • haloony
      • 5 mths ago
      • Reported - view

      rownie23  Hi!

      This is a really thourough tutorial! Thank you for taking the time to post it here.

      I am trying to use this for Chase Mobile notifications. I have it set to notify for any transaction above $1. I was able to get the test transaction to work but getting same variable split error.

      I attached pics of current notification, the autonotification settings and the error I am getting. I figure I am doing something wrong trying to adapt it for Chase

      Thanks,

      Hal

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 4 mths ago
      • Reported - view

      Hal Sitt Hi there! It is difficult for me to diagnose because I don't have the Chase app to test.

      But it looks like the variable "%antext" (by the way this means AutoNotification text) is not set. I would expect that the text would be the part of the notification that reads "Chase account....".

      Did you set up the event from an existing Chase notification?

      I would suggest that you make the task that triggers on the Chase notification event to make a test notification, and put all of the available AutoNotification variables into this notification, to see which variable contains the info you need. Is there an AutoNotification notification produced when the task runs?

      Like
      • Hal Sitt
      • haloony
      • 4 mths ago
      • Reported - view

      rownie23 Hi Again,

      Yes I set it up from an existing Chase notification. I also tried it with a Google Pay notification but still to no avail. I still have both in my notification shade to continue working on it. Here are the steps I took:

      1. Import your profile and task. Profile is linked to the new task

      2. Then I go into the event trigger and configure the AutoNotification Intercept

      3. I choose Fill from current and use my current Google Pay notification

        4. Then I select the values to fill

       5. Then I save the Intercept event

      6. Last, I run the imported transaction task and I get the variable split error. I do not get any notification from AutoNotification when I run the task.

      I am pretty sure I am missing a step somewhere.

      Thanks,

      Hal

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 4 mths ago
      • Reported - view

      Hal Sitt I think if you manually run the task, it will not run properly because it only triggers when the notification you are intercepting appears.

      What I would suggest doing is:

      When you have a notification you want to intercept, you can snooze this in the Android notification shade by slowly swiping left or right - you will see a little clock icon. Tap that and it wll change to "Snoozed for 1 hour".  Tap that and then select for 15 mins. This means that the notification will keep recurring while you make changes to the task.

       

      For the task itself:

      1. Either make a new task or disable everything in your current task.
      2. Add new action > plugin > AutoNotification > AutoNotification
      3. Tap the pencil for configuration
      4. Select texts
      5. Title - set to "testing notification intercept" (no quotes)
      6. Text - set to "triggered by xxxx" (no quotes, replace xxxx by whatever app produces the notification)
      7. Text expanded - set to (no quotes, each on  a new line):

      "antitle - %antitle

      antext - %antext

      ansubtext - %ansubtext

      ansummarytext - %ansummarytext"

      Save all of this. Then when the notification recurrs, check the notification that has been created - is the text you need displayed in this notification?

      Like
      • Hal Sitt
      • haloony
      • 4 mths ago
      • Reported - view

      rownie23 I was able to capture the Chase notification. Here is what I got:

       

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 4 mths ago
      • Reported - view

      Hal Sitt Perfect - this shows that what we need is actually in the variable %antext.

      When you were getting the variable split error, were you manually running the task?

      Like
      • Hal Sitt
      • haloony
      • 4 mths ago
      • Reported - view

      rownie23 Yes I was running it manually when I was getting the split error. here is what I get when it runs automatically with snoozed notification:

       I get the same error with the reverse task enabled or disabled. I think it is an issue with the 2 digit year

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 4 mths ago
      • Reported - view

      Hal Sitt Yes it will be. Although the amount is wrong too. Was this a Google Pay notification or a Chase notification, because a Google Pay notification should just work.

      mitelman Have you had any problems since we solved this for you? If not, would you mind uploading a copy of your profile and task for download and posting a link here?

      Like
      • Hal Sitt
      • haloony
      • 4 mths ago
      • Reported - view

      rownie23 

      It was Chase. Had to clear the Google Pay notification; it did not let me snooze it.

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 4 mths ago
      • Reported - view

      Hal Sitt That's weird, I could snooze my Google Pay notifications in order to set this up. Could we focus on the Google Pay notification first and get that working first?

      Like
      • Hal Sitt
      • haloony
      • 4 mths ago
      • Reported - view

      rownie23 I attached attempt with Google pay

      Like
      • mitelman
      • mitelman
      • 4 mths ago
      • Reported - view

      Hal Sitt rownie23 Here is a copy of my working profile that is working for me in Canada.

      Like
  • Hey rownie23, thanks for this.  I managed to make my way through this, got stuck on the fact that I needed to create a bunch of tasks in addition to the dummy task that was in step 1.  but after a bit I got it figured.

    When I try and run the task it gets stuck right at the start, and as I have never used Tasker and these addons before I feel a little helpless!  Here is the error that I receive, so hopefully you are able to help. I have tried using a space in the splitter, but it doesn't seem to make a difference as it doesn't seem to save the space.

    I am not sure if I need to do a payment in order to test it.

    Hopefully I do not get stuck on each step!

    Like
      • rownie23
      • Slate_Gray_Panther.7
      • 6 mths ago
      • Reported - view

      mitelman No problem, it looks like the error message is saying that %antext is not available, so it can't split it.

      If you run the task manually, the Google Pay notification must be available for the variable %antext to become populated.

      Like
  •  I had a Google Pay notification waiting when I ran it manually. I also tried later in the day at a store and nothing happened. Is there another log that shows if it tries or not?  

    Like
      • rownie23
      • Slate_Gray_Panther.7
      • 6 mths ago
      • Reported - view

      mitelman Could you show a screenshot of the Tasker profile please, the one that intercepts the Google Pay notification?

      The issue seems to be that the profile is not seeing the Google Pay notification.

      Like
      • mitelman
      • mitelman
      • 6 mths ago
      • Reported - view

      rrownie23 i believe this is what you are looking for?

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 6 mths ago
      • Reported - view

      mitelman Hmmm, that all looks correct. This is perculiar.

      You could open the AutoNotification app and check the log listings to see whether the notification is being intercepted. In the meantime I will do some more checking.

      Like
  • mitelman I have found the problem, its a big oversight on my part. By using the exisiting notification to set up the entry profile trigger, I made it only trigger to a very specific condition. Using you r example above, the transaction would only be entered into YNAB autoamtiacally if the transaction was at "TIM HORTONS #4763" and was exactly $2.02 with your Visa card ending 4407.

    Removing these from the trigger should get it to work properly.

    Apologies for the confusion!

    Like
  • rownie23  Thanks for the note.  I have tried to make the change, but still get the same error.  Have tried rebuilding other parts of the task, etc, with no success.  I am going to wipe out the whole thing and start from scratch to see where I get.

    Like
  • rownie23 I have wiped out and rebuild everything.  I still end up with the same error that I had before where it is getting stuck on the first variable split.  I do not think it is seeing the notification properly as I get the same error when I dismiss the google pay notification.  I wonder if the notification displays differently for me? But perhaps not since the time that I sent a copy of my config, it showed everything correctly when filling in from an existing notification.

     

    Any ideas?

    Like
      • rownie23
      • Slate_Gray_Panther.7
      • 6 mths ago
      • Reported - view

      mitelman Could you check to see whether Tasker and AutoNotification are "not optimised" in battery settings? This makes sure they don't get killed in the background.

      Settings > Apps & Notifications > Find Tasker > Advanced > Battery > Battery optimisation > Brings up a list of all "Not optimised apps". Make sure that Tasker and AutoNotification are in this list.

      Like
      • mitelman
      • mitelman
      • 6 mths ago
      • Reported - view

      rownie23 I checked and all the Twitter apps are not optimised as required, so it is not that. I am wondering if it is something in how the notification for Google Pay display works? Perhaps it is different here in Canada?  I haven't been able to understand enough yet about Tasker to understand where this error is coming from. 

      Here are a couple of notifications in case that helps. 

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 6 mths ago
      • Reported - view

      mitelman  I have to admit I'm struggling to understand why this isn't working for you. Plus, to make things even more complicated, I dropped my Android phone which is getting repaired - I'm not expecting it back soon due to the Christmas and New Year holidays. When I do, I will try to export the profile and task and provide you a cloud storage link to install them into your Tasker application. You will just need to make sure that the YNAB key, account and budget ID are input correctly to your account.

      Like
      • mitelman
      • mitelman
      • 6 mths ago
      • Reported - view

      rownie23 thanks for replying.  Bad news for you on the phone front! Hope the repair comes soon for you!  I did not know that you can export the tasks and profiles for this.  That might easily let me try this on my wife's phone as well, or it can send it to you too check too.  

      Thanks for keeping at this, I really appreciate it!

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 5 mths ago
      • Reported - view

      mitelman  OK, I have my phone back and have exported the profile   and task to Google Drive. Let me know how it goes.

      https://android.gadgethacks.com/how-to/tasker-101-import-tasks-profiles-0180273/

      Like
      • mitelman
      • mitelman
      • 5 mths ago
      • Reported - view

      rownie23 I have downloaded and installed the profile and task to my phone, configured the account and budget ID and changed the currency to $. Now I just need to make a purchase. In the meantime I did review the xml files and found a few differences. For your review I have exported and uploaded my two files here for you to review as well. https://1drv.ms/f/s!AmtStPKHjcbLxPhVS55OtbvCVOlJsg Hopefully this will get the thing working!

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 5 mths ago
      • Reported - view

      mitelman  From what I can see in your profile, this will only trigger when you make a payment at "PET VALU CANADA INC. #" for the value of $87.13, with your Visa ending 4007. Let me know what happens when you make a payment, although I suspect the auto transaction into YNAB will not happen.

      Like
      • mitelman
      • mitelman
      • 5 mths ago
      • Reported - view

      rownie23 OK, making some progress here.  Made a payment and I got an error!  It appears this error occurs in the last part of the task and is in regards to the date format:

      Autoweb Action Error

      {"error":{"id":"400","name":"bad_request","detail":"date must not be in the future or over 5 years ago"}}

      Since its title is AutoWeb that is why I think it is the last item of the task.  Also I have received the notification banner that you have the task create in Step 8.

      Any ideas?

      Interesting that my profile is set to only trigger for PET VALU.  I rebuilt it several times with no entries or banners, I had just assumed that it got inserted when the profile got stuck.

       

      Thanks,

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 5 mths ago
      • Reported - view

      mitelman The YNAB API needs the date in the format YYYY-MM-DD, which comes from the variable %ynabdatearr. This variable is also used in the test notification of the task, step 8. What is the date that is posted in this notification? 

      Like
      • mitelman
      • mitelman
      • 5 mths ago
      • Reported - view

      rownie23 I did not see a date anywhere on the notifications that I received.  I have dismissed them already so I cannot check them again.  I will have to try again when I go out to purchase something.

      Like
      • mitelman
      • mitelman
      • 5 mths ago
      • Reported - view

      rownie23 ok, I managed to grab one with the date  see attached  

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 5 mths ago
      • Reported - view

      mitelman OK, so the date that is being posted in the test notification is "14-01-2020". The format should be "2020-01-14".

      So, this appears to be something different to what I see here in the UK. In both the task that I have given you AND the task you provided me with, there is an action that is called "Array Process" (action number 6), which is reversing the date.

      If you long press on this action, it should highlight in orange. Then in the top right corner of the screen, tap the on/off button.

       

      A grey line will appear to the left of the action. This means that the action is not taken when the task is ran. Long pressing and toggling the on/off button brings it back into play. Ideal for testing purposes 😉

       

      Fingers crossed, this is the cause of the problems!!! 🤞

      Like
      • mitelman
      • mitelman
      • 5 mths ago
      • 1
      • Reported - view

      rownie23 that did it!  Yay!  Seeing that transaction go through today was a thing of beauty!  Thanks so much for your work on this! I really appreciate it. 

      Like 1
      • rownie23
      • Slate_Gray_Panther.7
      • 5 mths ago
      • Reported - view

      mitelman YES!!! 👏😁 I'm so pleased we got this working! Happy budgeting (and spending)!

      Like
  • Oh my lord thanks for this. 

     

    For the last year or two I have had tasker opening up ynab and stepping through the new transaction entry after I swipe away a Google pay notification. Keen to set this up with the API now. So much smoother.

    Just read over things quickly so may have missed it but you don't seem to do anything with the payee? Do you correct them in ynab later manually?

    Like
      • rownie23
      • Slate_Gray_Panther.7
      • 3 mths ago
      • Reported - view

      SgtBatten No the payee is entered automatically too. Initially it can cause the transaction to be not categorised correctly in YNAB, but if you can set rules up in YNAB on the web to get around this.

      Give it a go, its a game changer.

      Like
      • SgtBatten
      • SgtBatten
      • 3 mths ago
      • Reported - view

      rownie23 Yeah I have no idea why I didn't use the built in ynab method for payee rules. My current one has a prompt for me to type the payee manually but it also has a database so once I've been to a store once I don't need to type it again. Same result as ynab rules but silly of me to not use the existing built in method. I'm pretty much setup but i'm adding an extra variable to change which account it gets entered in. I don't have a google pay notification handy so any chance you can tell me which antext split fields contain the VISA .... 1234 parts.

       

      Really easy guide to follow, thanks

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 3 mths ago
      • Reported - view

      SgtBatten That's tricky because it splits on the space, so if the payee is one word, the number of the %antext variable will be different if the payee is more than one word.

      You could copy the whole %antext into a new variable to use as you wish, then split on the word "Visa" or try the "..." part of it.

      Like
      • SgtBatten
      • SgtBatten
      • 3 mths ago
      • 1
      • Reported - view

      rownie23 Ahh I see. I'll try a regex match instead. Thanks. I'm doing exactly what you just posted below except different accounts rather than different budgets.

      Like 1
  • In addition to this, you can copy the add transaction step in the Tasker task and add "if" conditionals to them. This allows you to post transactions to multiple budgets, if that's what you need.

     

    I have a personal budget and a joint budget. In Google Pay I select either card and pay - now the transactions get added to the respective budget. It is so satisfying!

    The condition you want to check on is the last 4 card digits.

     

    Like
      • SgtBatten
      • SgtBatten
      • 3 mths ago
      • Reported - view

      rownie23  So you seem to be okay using antext5 here to get the card number but you mentioned it is not static due to the payee. Then again it must be static as antext12 is also used for the amount too. Maybe we crossed wires.

      Like
      • rownie23
      • Slate_Gray_Panther.7
      • 3 mths ago
      • 1
      • Reported - view

      Yes, my mistake: the payee is %antitle. Ignore my previous advice, sorry!

      Like 1
      • SgtBatten
      • SgtBatten
      • 3 mths ago
      • Reported - view

      rownie23 no problem. Thanks for the guide. Think I'm all set now

      Like
  • Hello, and thanks for excellent tutorials! Exactly what I've been trying to achieve!

    I'm running in to problem, however, at point 16 in the second one, where the manipulation of the notification data is done. How do I get to the next screen, and where can I do these changes?

    (I'm quite new to Tasker.. this might very well be painfully obvious to you, but I can't find it!)

    Like
      • SgtBatten
      • SgtBatten
      • 2 mths ago
      • Reported - view

      Johannes in tasker select tasks and then chose the task you have made for this purpose.

      Like
      • SgtBatten
      • SgtBatten
      • 2 mths ago
      • Reported - view

      Then on the next screen select the action you need to edit. 

      Like
      • SgtBatten
      • SgtBatten
      • 2 mths ago
      • Reported - view

      Then you can edit the values for each action depending on what's required. 

      Like
      • Johannes
      • Musician
      • Navy_Blue_Robot.10
      • 2 mths ago
      • Reported - view

      SgtBatten Thanks for helping out! Thing is, I don't get the list of actions when selecting the task - just "1. AutoWeb Web Service"?

      Like
      • SgtBatten
      • SgtBatten
      • 2 mths ago
      • Reported - view

      Johannes haha oh I see. That step actually requires you to create the items that then show in step 17. You press the plus icon to add actions.

      If you can see my post below I just uploaded a template which you can import into tasker with everything you need already created and when you open it it tells you what to edit to get it working.

      Like
  • Hey guys. 

     

    I wanted to share my project template which can be used after step 17 of the original post above. 

    There are instructions included inside the task to walk you through the rest.

    I have setup this template to provide a couple of additional benefits. 

     

    1. Most of the work is done for you, Just fill in some areas to personalise it.

    2. It works with Google and Samsung Pay

    3. It will work with all date formats.

    4. It has some small test actions to check everything is working. 

    Massive thanks to rownie23

    Like
  • rownie23  I'm having an interesting issue where the task doesn't seem to be firing consistently if the phone is locked. The only security i have on google pay is to wake the phone so I don't normally unlock it to pay for things.

    Like
Like3 Follow
  • 3 Likes
  • 1 mth agoLast active
  • 57Replies
  • 971Views
  • 7 Following