Triggers: Difference between revisions

5 bytes removed ,  6 October 2016
m
no edit summary
mNo edit summary
mNo edit summary
Line 349: Line 349:
In the following example of task creation, text will be taken from the Memento library entry.
In the following example of task creation, text will be taken from the Memento library entry.


<source lang="javascript" line>
<source lang="javascript">
var commands='[{"uuid":"' + guid() + '","temp_id":"' + guid() + '","type":"item_add","args":{"content":"' + entry().field("Task") + '"}}]'
var commands='[{"uuid":"' + guid() + '","temp_id":"' + guid() +
result = http().get("https://todoist.com/API/v7/sync?token=15281e8e4d499dаff817af0b14112eac3176f9dc&commands=" + encodeURIComponent(commands))
'","type":"item_add","args":{"content":"' + entry().field("Task") + '"}}]'
result = http().get("https://todoist.com/API/v7/sync?token=15281e8e4d499dаff817af0b14112eac3176f9dc&commands=" +
encodeURIComponent(commands))
if (result.code == 200) message('Task has been successfully created")
if (result.code == 200) message('Task has been successfully created")
</source>
</source>