Help with combining multiple selection prompts and text


#1

All,

I just stumbled on the action group that provided some examples of prompts which triggered an idea. Id like to create a template to schedule volunteers at my church every weekend. There are 4 time slots per weekend and each slot has 5 volunteer positions. I’d like to quickly create an email to tell the volunteer group how many open positions are left for each time slot.

Im thinking I could use the Select prompt action that @agiletortoise posted and use the multiple selection prompt. My issue is, how do I combine the selections with text? So if we needed help at timeslots 1,3 and 4, the output would look like:

Timeslot 1
Timeslot 3
Timeslot 4

Thank you for the help. These examples are teaching me how to use Javascript and Drafts 5!


#2

Hi. Can anyone help with this? Or point me in the are direction?


#3

I think what might give you the fastest entry is simply a pop-up of buttons to tap on that repeats four times allowing you to choose between 0 and 5 positions to fill. Otherwise I think you would end up with lots of tapping and scrolling.

Try this Javascript in an action step. It prompts four times and then just displays the output as a message to you. Assuming this is something like what you want you would then take this further by building up the content around these lines maybe through manual input in Drafts or by including some predetermined text in your action. If eveything is automatic you could then set the action to mail it out or you could again take a more manual approach if you are tailoring the content each time.

let strList = "";
let promptSlots = Prompt.create();
promptSlots.message = "How many positions are available to be filled?"
promptSlots.addButton("None");
promptSlots.addButton("One");
promptSlots.addButton("Two");
promptSlots.addButton("Three");
promptSlots.addButton("Four");
promptSlots.addButton("Five");

for (intCount = 1; intCount < 5; intCount ++)
{
	promptSlots.title = "Timeslot " + intCount;
	if (promptSlots.show())
	{
		if (promptSlots.buttonPressed != "None")
		{
			strList += "Timeslot " + intCount + " has " + promptSlots.buttonPressed.toLowerCase() + " unfilled position";
			if(promptSlots.buttonPressed == "One")
			{
				strList += ".\n";
			}
			else
			{
				strList += "s.\n";
			}
		}
		
	}
}

alert(strList);

Hope that helps.


#4

Thank you. I will give it a try answer let you know.


#5

If you can’t get it working in Drafts, you could also use Workflow to do it, and building the workflow would be easier than trying to figure out out the JS if you don’t know already know it (like me!).