Could we get an example of what getting an x-callback result might look like? I’ve had absolutely no luck getting anything returned on a simple create-note call in Shortcuts. The notes are created just fine, but the X-Callback Result variable doesn’t contain a thing.
First make sure you use version 5, earlier versions didn’t return anything. Next, the return value is an added parameter to your return x-success url. In other words, the call itself returns nothing, but if you provide a callback url with the x-success parameter, that url will be called with an additional parameter containing the return value.
For example, if you call it with an x-success parameter that is something like:
The result would be to create a new note in the project Project with the title Note and text something, and then to copy the note ID to the clipboard via an x-success callback to a Shortcut named Copy Agenda Note ID to clipboard.
Assuming the Shortcut works as prescribed, that would work?
Update: I tested it and it worked—sorta. I updated the “Copy” shortcut to create a full x-callback-url to open the ID’d note but can’t seem to make that work and I’m tired of trial and error right now.
Just an observation… Agenda doesn’t appear to be listed on the Apps page of http://x-callback-url.com which you reference above. You might want to get yourself on that list.
There was some mention of providing search support with the x-callback API. I would settle for being able to open Agenda in the Search All “tab” with text I passed in the URL as a good starting point. This would allow for some basic Alfred integration for me.
Also, while I am thinking of it, is there a way to create a note in a project and category? It is possible to have duplicate project names in different categories. Or do I have to rely on the identifier?
The list above is complete, so you can’t create projects at this point. There are a bunch of things there (eg listing projects, listing categories, adding projects, searching) still to do. No rest for the wicked!
It isn’t possible at the moment I’m afraid. Does it really need to be a prepend of text in the same note though? Wouldn’t it make sense to create a new note with the desired text? Given the default reverse chronological order this new note would sort to the top and as such keep the most recent info at the top of the project.
Your reply makes me think I may not be using Agenda as intended. While the app doesn’t lock users into a specific workflow, there does appear to be an ideal paradigm.
If you have the patience, I can briefly explain how I use Agenda. I do welcome feedback from the community, and I am willing to adjust my workflow in favor of a more efficient process.
Currently, I keep several generalized Agenda projects (i.e., Finances) within broad Agenda categories (i.e., Family.) Within these general projects, I keep one note per specific project. For instance, last month my village sent out trash tax statements, so I created a note in the Finances project to keep track of the taxes. I updated this single note as I progressed through the project. I used Drafts to append text to the note with each update adding a timestamp followed by the update text.
I safeguard my events, only linking notes to actual events on my calendar. I do not assign new notes to the current date by default. I realize this causes complications with searching notes using Agenda’s date tools. Using the village taxes project as an example, I added the due date to my calendar and linked the tax note to that date. For projects not associated with a calendar event, I keep the note organized and updated but do not connect it with a date.
I hope I described my note setup clearly. I realize my workflow may not embrace all of Agenda’s functionality. I am happy to entertain other’s opinions or ideas if I can improve my workflow.
There is not really one way to use the app. It depends on the “granularity” of your projects as to what is best. For example, if you were finding that your notes for each project you have were getting really long and ungainly, you might consider making the real life project into an Agenda project, and splitting that really big note over several notes (eg one per week, one per sub-topic etc).
But if you find your notes are workable with the current setup, I think your approach is the right one.
I am trying to set up a x-callback-url which will append a line to a note if it exists. If the note does not exist I am trying to use the &x-error parameter to add the note (with the intent of then putting an &x-success behind that to add the line). This currently works if the note exists, but it does not seem to add the note if it does not. Hoping someone can see what I am doing wrong.
Hmm, we haven’t tested this type of thing, to be honest. You are trying to call into Agenda while Agenda is still handling the previous request. I suspect that could lead to some odd behavior.
A way around may be to go back to shortcuts on error and issue the create-note there.
Ah, and you probably need to “percent encode” the special characters in the error URL, otherwise they could be confused for the first URL. Eg. & and ? etc.
I’ve just created a Shortcut that seems to almost successfully create a note with an image attachment using the URL scheme and base64 encoding. The image appears as a thumbnail in the note as I would expect; however, when I long press the image to get the image options popover, the “Preview” button does nothing. When I insert an image into a note normally, this button shows a full-screen version of the image. Does adding images via the URL scheme make the Preview function not work?
Can you give an example of how one would extract the note ID from Shortcuts after this step? I can’t seem to figure it out. See this Shortcut that I’m working on to create a new Agenda and Things item at once: I’d like the Agenda note ID to be passed into a new Things task, but am getting stuck.