Help

This Product Ideas board is currently undergoing updates, but please continue to submit your ideas.

Tabs & newlines in input.textAsync prompt

cancel
Showing results for 
Search instead for 
Did you mean: 
Kaley_White
6 - Interface Innovator
6 - Interface Innovator
Status: New Ideas
What is the proposed idea/solution?

Allow tabs ('\t') and newlines ('\n') in the prompt argument to input.textAsync.

How does is solve the user problems?

Multiline prompts would make longer prompts more readable. The following is, quite frankly, a mess:

Kaley_White_0-1671571143973.png

How was this validated?

Tabs and newlines in the prompt string are not shown. The above mess is generated by the following code:

 

 

const grps = ['Update Projects entry', 'Topic', 'Database', 'Results', 'Dev build', 'Initial meeting', 'Demo', 'Data sharing', 'Contouring', 'Model development', 'Interim analysis', 'Final analysis', 'Study proposal', 'Study protocol', 'Grant', 'Prospective data collection', 'CRA', 'REB', 'Abstract (will be published on its own)', 'Manuscript', 'Poster', 'Presentation', 'NDA', 'Privacy/security review', 'Cover letter'].sort();
var origPrompt = 'Record group to create. Choose a number.\n';
for(var i = 0; i < grps.length; ++i) {
    origPrompt += (i + 1) + '.\t' + grps[i] + '\n';
}
origPrompt += 'Group number: '
await input.textAsync(origPrompt);

 

 

Who is the target audience?

Users who want more formatting options in scripts, especially for longer text prompts.

-

Note that this wouldn't be an issue if radio button inputs were supported.

2 Comments
kuovonne
18 - Pluto
18 - Pluto

Even though this is a product suggestion, you may be able to get your desired behavior with existing features. 

You can output the details of your prompt using output.markdown() immediately before input.textAsync().

Or, you could use input.buttonsAsync() so that users can push a button for the desired choice without typing anything. 

Kaley_White
6 - Interface Innovator
6 - Interface Innovator

Actually, output.markdown doesn't work in this case:

 

const grps = ['Update Projects entry', 'Topic', 'Database', 'Results', 'Dev build', 'Initial meeting', 'Demo', 'Data sharing', 'Contouring', 'Model development', 'Interim analysis', 'Final analysis', 'Study proposal', 'Study protocol', 'Grant', 'Prospective data collection', 'CRA', 'REB', 'Abstract (will be published on its own)', 'Manuscript', 'Poster', 'Presentation', 'NDA', 'Privacy/security review', 'Cover letter'].sort();
var origPrompt = 'Record group to create. Choose a number.\n';
for(var i = 0; i < grps.length; ++i) {
    origPrompt += (i + 1) + '.\t' + grps[i] + '\n';
}
output.markdown(origPrompt);  // output.markdown(`${origPrompt}`) gives same result
await input.textAsync('Group number: ');

 

 

Kaley_White_1-1671633060630.png

But output.text does:

 

const grps = ['Update Projects entry', 'Topic', 'Database', 'Results', 'Dev build', 'Initial meeting', 'Demo', 'Data sharing', 'Contouring', 'Model development', 'Interim analysis', 'Final analysis', 'Study proposal', 'Study protocol', 'Grant', 'Prospective data collection', 'CRA', 'REB', 'Abstract (will be published on its own)', 'Manuscript', 'Poster', 'Presentation', 'NDA', 'Privacy/security review', 'Cover letter'].sort();
var origPrompt = 'Record group to create. Choose a number.\n';
for(var i = 0; i < grps.length; ++i) {
    origPrompt += (i + 1) + '.\t' + grps[i] + '\n';
}
output.text(origPrompt);
await input.textAsync('Group number: ');

 

Kaley_White_2-1671633188641.png