Prompt to select from list in a draft?

Hi all, relatively new action-creator here. I am trying to create a template for meeting notes and have greatly appreciated all the examples posted in the directory! One thing I’m trying to do that I can’t find an example for is prompt to enter project names from a list, where the list would be maintained in a draft that the action would read.

I can see examples for how to create a Prompt with selection options. But is there any way for the script to read the options from a designated draft (“project list”, say) that could be dynamically updated, rather than having to go into the script and manually update the selection list every time I add a new project?

Greatly appreciate any examples or suggestions!

Scripts can load a draft and read it’s contents, yes. Assuming you have created this draft with your list with one item on each line, you could do the following:

// get the real UUID value from (i) info for your draft with the list
let d = Draft.find("UUID-FOR-DRAFT");
// split the draft into an array of lines...
let list = d.content.split("\n");

// now you can loop over the lines to add to your prompt...
for (let item of list) {
    // add to prompt

Hopefully that will get you going in the right direction.