For this we have multiple cases:
- Passing over Other option in a single choice
- Passing over Other option in a multiple choice
- Passing over selected option from a single choice
- Passing over selected option from a single free text
- Passing over multiple selected option from a multiple choice
- Passing over multiple free text answers
- Passing over the answer written in the Other field from multiple choice to other types
Case 1: Passing over Other option in a single choice
Passing over the "Other" option from a single-choice question on a survey allows you to incorporate the client's specific response into either the question text or an answer option of another single-choice question.
For example, in the next survey, if the client selects 'Other' and specifies 'Yellow' in their response to the child question (Q1), the following master question (Q2) can incorporate 'Yellow' either into the question text or as an additional answer option, as shown below.
To add this function, follow these steps:
Step 1: Creating Child Single-Choice Question
In the selected survey, add a single-choice question and ensure it includes an option with an open-ended response. This will allow respondents to provide specific text that can be inserted into the Master question.
Step 2: Creating the Insertans Master Single-Choice Question
In the selected survey, add a single-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1";//change to current filter question code, the one you willñ get the answer from
let otherCode = "6"; //use the code from the other option
/* ENDS EDITING PART */
let label = response.answers.filter(elem => elem.questionCode === questionCode && elem.code === otherCode).map(elem => elem.value);
document.getElementById('textToChange').textContent = label;
Ensure to select the corresponding questionCode
and otherCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the text from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of the JavaScript to include the <span>
element in multiple areas of the master question.
Case 2: Passing over Other option in a multiple choice
Passing over the "Other" option from a multiple-choice question on a survey allows you to incorporate the client's specific response into either the question text or an answer option of another multiple-choice question.
For example, in the next survey, if the client selects 'Other' and specifies 'Yellow' in their response to the child question (Q1), the following master question (Q2) can incorporate 'Yellow' either into the question text or as an additional answer option, as shown below.
To add this function, follow these steps:
Step 1: Creating Child Multiple-Choice Question
In the selected survey, add a multiple-choice question and ensure it includes an option with an open-ended response. This will allow respondents to provide specific text that can be inserted into the Master question.
Step 2: Creating the Insertans Master multiple-Choice Question
In the selected survey, add a multiple-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1";//change to current filter question code, the one you willñ get the answer from
let otherCode = "6"; //use the code from the other option
/* ENDS EDITING PART */
let label = response.answers.filter(elem => elem.questionCode === questionCode && elem.code === otherCode).map(elem => elem.value);
document.getElementById('textToChange').textContent = label;
Ensure to select the corresponding questionCode
and otherCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the text from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of the JavaScript to include the <span>
element in multiple areas of the master question.
Case 3 Passing over selected option from a single choice
Passing over the selected option from a single-choice question on a survey allows you to incorporate the client's response into either the question text or an answer option of another single-choice question.
For example, in the next survey, if the client selects the option 'Yellow' for the child question (Q1), the following master question (Q2) can incorporate 'Yellow' either into the question text or as an additional answer option, as shown below.
To add this function, follow these steps:
Step 1: Creating Child Single-Choice Question
In the selected survey, add a single-choice question with as many answer options as you desire.
Step 2: Creating the Insertans Master Single-Choice Question
In the selected survey, add a single-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1";//change to current filter question code, the one you willñ get the answer from
/* ENDS EDITING PART */
let label = response.answers.filter(elem => elem.questionCode === questionCode).map(elem => elem.label);
document.getElementById('textToChange').textContent = label;
Ensure to select the corresponding questionCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the text from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of the JavaScript to include the <span>
element in multiple areas of the master question.
Case 4 Passing over selected option from a single free text
Passing over the selected option from a single-text question on a survey allows you to incorporate the client's response into either the question text or an answer option of another single-choice question.
For example, in the next survey, if the client writes 'Yellow' in response to the child question (Q1), the following master question (Q2) can incorporate 'Yellow' either into the question text or as an additional answer option, as shown below.
To add this function, follow these steps:
Step 1: Creating Child single-text Question
In the selected survey, add a single-text question.
Step 2: Creating the Insertans Master Single/Multiple-Choice Question
In the selected survey, add a single-choice or multiple-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1"; //change to current filter question code, the one you willñ get the answer from
/* ENDS EDITING PART */
let label = response.answers.filter(elem => elem.questionCode === questionCode).map(elem => elem.value);
document.getElementById('textToChange').textContent = label;
Ensure to select the corresponding questionCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the text from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of the JavaScript to include the <span>
element in multiple areas of the master question.
Case 5 Passing over multiple selected option from a multiple choice
Passing over the selected options from a multiple-choice question on a survey allows you to incorporate the client's responses into either the question text or an answer option of another single-choice question.
For example, in the next survey, if the client selects the options ‘Red’ and 'Yellow' for the child question (Q1), the following master question (Q2) can incorporate 'Red' and 'Yellow' either into the question text or as an additional answer option, as shown below.
To add this function, follow these steps:
Step 1: Creating Child multiple-choice Question
In the selected survey, add a multiple-choice question with as many answer options as you desire.
Step 2: Creating the Insertans Master Single/Multiple-Choice Question
In the selected survey, add a single-choice or multiple-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1"; //change to current filter question code, the one you willñ get the answer from
/* ENDS EDITING PART */
let labels = response.answers
.filter(elem => elem.questionCode === questionCode)
.map(elem => elem.label);
let textToChange = document.getElementById('textToChange');
textToChange.innerHTML = ""; // Clear any previous content
labels.forEach(label => {
let p = document.createElement("p");
p.textContent = label;
textToChange.appendChild(p);
});
Ensure to select the corresponding questionCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the text from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of the JavaScript to include the <span>
element in multiple areas of the master question.
Case 6 Passing over multiple free text answers
Passing over the selected options from a free-text question on a survey allows you to incorporate the client's responses into either the question text or an answer option of another single_choice question.
For example, in the next survey, if the client writes the options 'Yellow' and 'Purple' for the child question (Q1), the following master question (Q2) can incorporate 'Yellow' and 'Purple' either into the question text or as additional answer options, as shown below.
To add this function, follow these steps:
Step 1: Creating Child multiple-text Question
In the selected survey, add a multiple-text question with as many answer options as you desire.
Step 2: Creating the Insertans Master Single/Multiple-Choice Question
In the selected survey, add a single-choice or multiple-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1"; //change to current filter question code, the one you willñ get the answer from
/* ENDS EDITING PART */
let labels = response.answers
.filter(elem => elem.questionCode === questionCode)
.map(elem => elem.value);
let textToChange = document.getElementById('textToChange');
textToChange.innerHTML = ""; // Clear any previous content
labels.forEach(label => {
let p = document.createElement("p");
p.textContent = label;
textToChange.appendChild(p);
});
Ensure to select the corresponding questionCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the answer from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of the JavaScript to include the <span>
element in multiple areas of the master question.
Case 7 Passing over the answer written in the Other field from multiple choice to other types
Passing over the selected options from a free-text question on a survey allows you to incorporate the client's responses into either the question text or an answer option of another single_choice question.
For example, in the next survey, if the client selects the options ‘Red’ and 'Yellow' for the child question (Q1), the following master question (Q2) can incorporate 'Red' and 'Yellow' either into the question text or as an additional answer option, as shown below.
To add this function, follow these steps:
Step 1: Creating Child multiple-text Question
In the selected survey, add a multiple-text question with as many answer options as you desire.
Step 2: Creating the Insertans Master Single/Multiple-Choice Question
In the selected survey, add a single-choice or multiple-choice question and include the following JavaScript:
/* START EDITING PART */
let questionCode = "Q1"; //change to current filter question code, the one you willñ get the answer from
/* ENDS EDITING PART */
let labels = response.answers
.filter(elem => elem.questionCode === questionCode)
.map(elem => elem.value);
let textToChange = document.getElementById('textToChange');
textToChange.innerHTML = ""; // Clear any previous content
labels.forEach(label => {
let p = document.createElement("p");
p.textContent = label;
textToChange.appendChild(p);
});
Ensure to select the corresponding questionCode
of the child question in the JavaScript, and include a <span>
element with the ID 'textToChange' at the desired position of the master question as follows:
<p><span id="textToChange">CHANGE</span></p>
This will allow the answer from the first question to be inserted where the <span>
element is placed, either in the question text or the answer option. If desired, you can edit the ID 'textToChange' in both the JavaScript and the <span>
element. Additionally, you can add multiple instances of JavaScript to include the <span>
element in multiple areas of the master question.