Creating $ask with answer from a previous $ask
Posted: Thu Oct 17, 2019 12:22 pm
I'm creating a template where I ask for a product name that will be reused with an ID of name:
${answer(@name)}
I want to reuse the key as part of another ask. I set up this ask with radio buttons for two different possible sentences that can be inserted, depending on the option that the writer picks. The name needs to be reused in both sentences. This is the $ask I've set up:
${ask('How is the product activated?', radio, (
'<p>${answer(@name)} is active by default.</p>'
:'It is active by default';
'<p>${answer(@name)} must be enabled with a plugin.</p>'
:'It must be activated with a plugin'))}
With the $answer variable, the dialog box for this $ask doesn't render properly. The dialog box displays with Cancel and OK buttons, instead of radio buttons with the answers I've listed above.
${answer(@name)}
I want to reuse the key as part of another ask. I set up this ask with radio buttons for two different possible sentences that can be inserted, depending on the option that the writer picks. The name needs to be reused in both sentences. This is the $ask I've set up:
${ask('How is the product activated?', radio, (
'<p>${answer(@name)} is active by default.</p>'
:'It is active by default';
'<p>${answer(@name)} must be enabled with a plugin.</p>'
:'It must be activated with a plugin'))}
With the $answer variable, the dialog box for this $ask doesn't render properly. The dialog box displays with Cancel and OK buttons, instead of radio buttons with the answers I've listed above.