📜 ⬆️ ⬇️

We pump Google Tasks using a third-party service: repetitive tasks, sharing, notifications about deadlines and other features

Recently on Habré we published a small overview of the task management system we are working on. One of its features is one-way and two-way synchronization with Google Tasks. By setting it up, you can significantly expand the possibilities for working with your tasks in Google Tasks, for example, by quickly implementing the following “buns”:

image

The implementation of all this is done through synchronization with our service, i.e. we don’t talk about any “hacks” or undocumented features of Google Tasks, but implement them through the processing of your tasks with us. Therefore, if you do not agree to entrust your tasklists to third-party sites, then our solution is not for you.

In the comments to the previous post, we were "pecked" for the design, so all these days we worked on Russification and combing the design and interface. We admit honestly, the design was far from the first place in the development, the implementation of functions took most of the time. But today the conversation is not about that, because the implementation of the above-mentioned "buns" will require a fairly short-term setup of your account with us, and then you can not come to us. It is on such use cases that I want to concentrate on this post.

The proposed options for using our service were not originally planned, but in the process of development it turned out that there was already enough functionality and it was interesting to try new scenarios.
')
First of all, about the very proposed principle of work. It is simpler to present our service as a repository of tasks that can take everything into account, incl. future tasks, aliens, create them, delete, modify, issue them in the right form and filter by all sorts of criteria. Through constant synchronization (or replication of changes), it is possible to build your work like this - most of the work with tasks is done in Google Tasks, all changes are constantly synchronized with your account with us. On our side, the rest of the actions (triggers, notifications, letters) are processed and then synchronized back. In general, nothing revolutionary, with the help of some services it is possible to organize something similar, but we decided to “pump” this mechanism.

Sync Setup


First of all, to give our service access to your Google Tasks tasks, you need to register with us and follow the “log in” link from the “Sync” window:
image

and confirm permission to access your tasks:
image

After that, the authorization status will change to OK. Interaction with Google Tasks is configured using "synchronization pairs", which may be several. Setup is to install:

image

Also for one-way synchronization in Google Tasks, the choice of a synchronization option is available (more on that below). Google Tasks does not support push technology, so real-time synchronization cannot be done.

A synchronization log is also available:
image

Synchronization is carried out periodically by comparing existing tasks in Google Tasks and our service. Bilateral synchronization assumes asboltic identity of the existing tasks on both sides, so when installing it, all existing tasks will be copied from each side to the opposite. On subsequent synchronizations, only changes will be copied. If you simultaneously change the same task on both sides since the last synchronization, Google Tasks will have priority.

Creating Future (Deferred) Tasks in Google Tasks


In order for a task to appear in Google Tasks only at a certain time, you need to create it with us, in the “Date of task” field specify the time and date. After this date, it will become relevant (will be displayed on the current date) with us and then appear in Google Tasks. Depending on the synchronization frequency settings, it will appear there either within 15 minutes or within an hour, etc.
More and in pictures
We create a task for us, and in the field “Date of task” we indicate the desired future date. Such a task will not be displayed by us until this date is reached, or this or a later date is not selected in the calendar.

image

Next, set up one-way or two-way synchronization of the list in Google Tasks. If you specify a filter in the “Filter or list” field, then make sure that the “Show future tasks” option was not in the filter settings .:

image

After the first synchronization, all tasks that have already occurred or tasks without a date will be copied to Google Tasks, and our task will be copied only at 00:00 on January 25, 2014. More precisely, within 15 minutes after this time.

Recurring Tasks in Google Tasks (periodic repetition of a task or its “recovery”)


We have implemented several mechanisms for repeating tasks, but for now let's stop at the simplest and, in fact, the most frequently needed - when repeating a task means not creating a second instance of the task, but “restoring” (i.e., the task performance mark is removed again) . As an example - we need to remind ourselves about visiting the pool on Saturday. We do the task “Swimming pool on Saturday”, the date of the task can be not set, because for the time being we realize everything in a simple way. And we hang the trigger on this task (the list of triggers for the task is called by the "Triggers" item in the context menu called by the right mouse button on the task). The trigger type is “Schedule”; we set the nearest necessary date in the future (exactly in the future), when the task should become unfulfilled, for example, on December 29. Action - "Mark as unfulfilled." Install a repetition every 7 days, starting from December 29. The field "Distributed to" is left "Only for this task." As a result, on December 29, the task will be marked as unfulfilled (if it has been completed before) and after a while (synchronization period) these changes will reach Google Tasks.
More and in pictures
Create a task:

image

On the context menu on the task, we call the setting of its triggers:

image

We configure the trigger so that it does this task unfulfilled on Saturdays at 7 am:

image

Well, do not forget to set up two-way synchronization for the "Personal" list:

image

Everything. After the synchronization is set, the task will be copied to Google Tasks and in the future, no matter where you mark the task completed - with us or Google Tasks, every Saturday at 7 am it becomes unfulfilled both there and there. Perhaps the example with a pool is a little unsuitable, as an option, you can present the task as “Cleaning”, “Request Bank statements, etc.”. Note that for this type of task repetition, two-way synchronization is necessary.

Repeating (restoring) a task in Google Tasks with a set delay after execution


Again I will give the simplest household example. Suppose you need to do the cleaning every 10 days. Repetition (restoration) of the task “House cleaning (kitchen, living room)” every 10 days is not an option, since some days you will be late with the cleaning and the next task will arise too soon - there will be less than 10 days between the cleaning, and why should we do extra work. Therefore, it is easier to proceed as follows. The task “Cleaning the house (kitchen, living room)” is set with a trigger that is triggered when the task is completed, marking the task again unfulfilled both with us and Google Tasks 10 days after its completion.
More and in pictures
We create a task, the date of the task can not be set:

image

From the context menu, we call the trigger setup:

image

Add a trigger:

image

Well, do not forget to set up two-way synchronization of this task list with Google Tasks:

image

Everything. When synchronizing the tasks for the first time, they will be copied from both sides, later when you perform this task either we or Google Tasks will trigger the trigger, which after 10 days will return this task (first with us, and then after a while to Google Tasks). Whenever you do the cleaning (more precisely, noted that you did), after 10 days the task will reappear. Deferred actions (that is, its recovery in this case) in the system are not directly views, but in the future we will make a list of all planned future actions on the task, so that it will be clear how the system will behave.

Sharing (sharing) Google Tasks tasks across multiple users


The task is a little more difficult, because manipulations will need a little more. Google Tasks does not allow you to transfer access to your tasks to other users. Therefore, the sharing of a specific Google Tasks task list among several users is implemented as follows - for each of the Google Tasks users, we set up two-way synchronization with the shared list with us. Those. The sequence of actions is as follows:
  1. Google Tasks users who want to share their own or someone else’s list with other users of the same Google Tasks are registered with us (you can also register using your Google ID). One of our users can be associated with only one Google account, so each user is required to register with us.
  2. on our service, one of the users (let's call it “owner”) provides access to one of its lists to other users (if desired, the owner can set each connected user with different access rights)
  3. all users set up two-way synchronization in Google Tasks

As a result, each user has in Google Tasks a shared joint task list, the same as that of other users. More precisely a copy. More precisely constantly updated copy. Making changes to their copy of the list, after some time they are synchronized with our service and “spread out” to other users. Some users can be made "read-only".
More details and in pictures on the simplest everyday example.
Suppose there are two Google Tasks users who want to share a common shopping list together. Let's take as a basis the list of one of the users:

image

This user registers with us, creates a “Purchase” task list with us and sets up two-way synchronization with his list in Google Tasks. I will not discuss these steps in detail, this seems to be clear from the preceding paragraphs. After successful synchronization, the list with us is filled with tasks from Google Tasks. A user here can edit tags, task dates, other fields. But only task names, notes and deadlines will sync with Google Tasks.

image

Since we can only have one Google Tasks account for one account, then in order to delegate access to your tasks to another Google Tasks user, it must also be registered with us separately. Those. The second user registers with us and provides access to Google Tasks. Next, we need within our service to provide access to the list of "Purchases" of the first user to the second user. To do this, the first user opens the setting of his lists and takes from there a link to the shared list from the "Share Link" column with the name "Full Access".

image

Further, this link is transmitted to the second user, who after clicking on it (at this moment he needs to be logged on our service) receives the message " Congratulations! Access granted, now reload the main page ." Now the second user has a common list available:

image

Next, the second user is left in turn to set up two-way synchronization with his list in Google Tasks and that's it.

If in the process of granting access get the message "Access denied. Maybe this google account is already connected to another user at betasked.ru? ”, Then try to exit again from the current Google account (if it is open), or do the same in Incognito mode (for Google Chrome).

In the future, for both users there is no need to log in to our service; all modified tasks in Google Tasks for any user will be periodically synchronized and changed by another Google Tasks user. The users working together with one list, can be as much as necessary.

Sharing read-only tasks of Google Tasks to other users


The task is similar to the previous one, only with some features. Sometimes you need to give access to your list to another person, but it is undesirable to be able to modify the data. This task can be solved by one-way synchronization of tasks from us in the Google Tasks user who is granted read-only access. Strictly speaking, this is not quite “read-only”, this does not allow Google, but due to constant synchronization, all changes manually made by the user will be erased. The user can also add his tasks there, but during synchronization they will not be affected, since sync assumes that only tasks created during sync can change and delete on the Google Tasks side.
More and in pictures
Probably there is no point in giving similar screenshots to the previous paragraph, since the sequence is the same. Is that the second user must configure one-way synchronization. True, this particular solution has a slight flaw - the second user of the task in Google Tasks cannot change, but in our web interface it can. Therefore, the solution to this contradiction may be as follows - the first user can set the “View Only” rights of tasks from the shared list for the second user:

image

Then the second user will not change the task in this list. You can also set other rights, for example, “Add and edit (without deleting)”, then the second user will be able to change tasks, but not delete. Who needs even more fine-tuning, you can prevent the change of a specific field, for example, the date and the name of the task. Then the second user will only be able to add tasks to the used joint list and change notes for existing tasks.

Email notification of upcoming deadlines for tasks from the Google Tasks list


It is such a function that perhaps few people need, but we use it quite actively.
To receive notifications by mail about the upcoming (for example, 7 days) deadlines (due date, “task deadline” in Google terminology) for tasks from a certain list, you can do this:

More and in pictures
The user registered with us creates a list to which tasks from Google Tasks will be synchronized. Next, log in to Google Tasks and set up synchronization:

image

After saving the settings, tasks from Google Tasks are copied to the “Main” list. Next, set the trigger for the entire list, it is available on the context menu item with the right click on the list name:

image

Install the trigger, it will work 7 days before the due date of the task:



Everything. We receive notifications with custom text and subject:

image

Note - while the trigger system is implemented so that the trigger used in this example will be triggered even when the task is marked as completed. This, of course, is not always convenient. We are still thinking about the most convenient mechanism for solving this problem.

Creating Tasks in Google Tasks by Mail


To add tasks to Google Tasks from emails, you can use this mechanism. Each task has its own e-mail address (it is available under the “Properties” item of the task context menu), when sending a letter to it after some time, this task will have a subtask, the name of which will be taken from the subject of the letter, and notes from the body of the letter . The text is taken without html tags, so if the body of the letter is in html format, then the text will be shielded tags. For this reason, it is better to write plain text letters. The task we have created from the letter by synchronization will appear in Google Tasks after a while. For this option, we will need to configure either two-way or sync options for the “From betasked to Google Tasks” option.
More and in pictures
When you right-click on any task or folder, the context menu is available by clicking on the "Properties" item:

image

When sending a letter to the address specified in the "Address for subtasks" field, a subtask from this letter will be created after some time. To transmit all this to Google Tasks - set up a simple (one-way) synchronization.

Email notification of new tasks in a specific Google Tasks list


To solve this problem, we will use the opportunity to install a trigger on the entire task list (triggers can be set to a specific task, a chain of repetitive tasks, tasks with a specific label, a specific list, or even to all user tasks). When you create a task (no matter how - when you create it in our web interface or in Google Tasks) it will work and perform the action “Notify me by e-mail”, i.e. for example, send a letter to the user's mail with the name of the created task in the subject line and task notes in the body.
More and without pictures
To accomplish this task, we need to set up the synchronization of the tasks “From Google Tasks to betasked”. It is better to allocate for this a separate task list on our service and then install a trigger on the entire list, triggered “When creating a task” with the action “Notify me by e-mail”. Editing triggers for the entire list is invoked by the context menu item with a right click on the list name (screenshots can be seen in the “Mail notification of upcoming deadlines for tasks from the Google Tasks list”, all the same). The subject and the message text can be not filled, and it is possible and to fill as follows:
Topic - “Task %% this.name %% created”
The text is "%% this.notes %%".
As a result, a letter with the name of the created task in the subject line and notes of the task in the body will be sent to the user's mail.

The nuances of one-way synchronization from betasked to Google Tasks


Separately, I will describe the nuances of synchronization from betasked to Google Tasks, because it is more in demand. Installing this synchronization into the existing Google Tasks list will not delete the existing tasks there. If any tasks can be further deleted, then only those that were copied during the synchronization process. You can also create tasks in the same list on the side of Google Tasks, they will not be overwritten. Those. You can keep tasks synchronized with us and not synchronized in one task list.

The following options are available for installing possible actions on the Google Tasks side:

In most cases, you can not go into these options and leave the default option.

Ask "why such difficulties"? Let me explain with examples.
Suppose you set a weekly repetition of a task (let it be through a trigger that makes the task unfulfilled every 7 days).

Suppose you entered a task to stop drinking on January 1, 2015. When it arrives on January 1, it is synchronized in Google Tasks, but later, quitting drinking, you will want to mark this task as completed in Google Tasks (I assume that for current work with current tasks it’s faster and more convenient to edit tasks there). Yes, you mark it or delete it, but at the next synchronization it will change again to its original form, since we are talking about one-way synchronization, and it involves maintaining copies of tasks from the source. Therefore, the solution here is to select the option “Only create tasks (deleted ones are not re-created)” in the “Permissions” field. This will allow in any way to edit or delete already synchronized tasks, they will not be re-created.

Therefore, in short, setting permissions for this type of synchronization serves to ensure a comfortable follow-up to Google Tasks. You can avoid such difficulties by setting up two-way synchronization, but for security reasons, one-sided is recommended if it is sufficient. Despite the fact that we started synchronization five months ago and there were no special files, there still remains some subconscious fear that somewhere in the algorithm there is a potential bug that, according to the law of meanness, will rub all tasks. If someone wrote an algorithm for two-way synchronization of hierarchical structures (this is the main difficulty), he will probably understand. Therefore, in order for sure not to touch user data in case of any failures, you can use one-way.

Conclusion


Finally, I will state some important points for those interested in details:

. Google OAuth, . Google , .
(Android, iOS) ( , ), .

Source: https://habr.com/ru/post/210754/


All Articles