I have a prompt step that populates a ‘dotags_button’ template tag. Depending on the presence of a ‘Callback URL’ action step, the [[dotags_button]] template tag will go missing. Here are the specific steps:
Prompt. key: dotags (include buttons).
Callback URL (wait for response TRUE): streaks://x-callback-url/completed/F9FE30BD-012F-4046-9390-228798A0518F
Script, which includes: draft.setTemplateTag("wordcount", stats.wordCount());
If the Callback URL step is disabled, [[dotags_button]] is properly populated at the end URL step. If I enable the Callback URL step, [[dotags_button]] contains the prompt selection after the Callback URL, but the value is missing after the Run Shortcut step. I’m very confused! Can anyone offer help?
When the user selects done, the shortcut completes and control will return to Drafts.
Content of temptag is passed to the shortcut to be displayed.
Displays the contents of temptag in a prompt (for a second time).
In my test (which you can download and reproduce), the output for both prompts and the shortcut was “lorem ipsum”.
In effect, I’m not seeing the issue occurring in my simplified test which I think you are describing.
Can you share some actions like the above that we could use to reproduce your issue?
I’m afraid I don’t use Streaks and so can’t attempt to reproduce what you have. It may be that this is specifically related to Streaks, but if that’s the case, if you substitute in the Shortcuts shortcut call I use above for the Streaks one, that may give you some additional insight as to if the issue is there or elsewhere in the action.
Also if you add a prompt to display your template tag between each step as I used in my example, that will confirm which step is affecting your tag value. I note that you have said it is the Shortcut step, but you haven’t indicated how you know it is that rather that either of the two prior steps.
EDIT:Added versions to cover both the beta and non-beta for template tag setting options.
Interesting. Rather obscure issue, but definitely a bug. Will fix in the next update. Problem comes from Drafts refreshing the draft when returning from a callback to make sure nothing has changed while you were gone from the app (e.g. the Shortcut itself could update content of the draft) and the temp template tag storage not getting updated properly in the scripting runtime.