Reversing the Order of System Prompts in Templater Plugin

Hello,

I’ve been using the Templater plugin to create notes in Obsidian. Currently, when I use this sequence in my template:

<% tp.system.prompt("Question 1") %>
<% tp.system.prompt("Question 2") %>
<% tp.system.prompt("Question 3") %>

the prompts ask for input starting from Question 3 to Question 1, instead of 1 to 3. Is there a way to reverse this so they are prompted in the order they appear in the script?

Does anyone know if this functionality exists within Templater?

What I’m trying to do

I want the input prompts to appear in the order they are listed in the template.

Things I have tried

I’ve looked through the Templater documentation but haven’t found anything related to reordering the prompts.

Any advice or solutions would be much appreciated!

Okay I found a solution. It works like this:

<%*  
let question1 = await tp.system.prompt("Question 1");
let question2 = await tp.system.prompt("Question 2");
%>

<% question1 %>
<% question2 %>

Or alternatively this also works:

<%await tp.system.prompt("Question 1");%>
<%await tp.system.prompt("Question 2");%>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.