Display Subheaders Using TOC (Table of Contents) and Loop and Merge | XM Community
Solved

Display Subheaders Using TOC (Table of Contents) and Loop and Merge

  • 5 December 2018
  • 9 replies
  • 45 views

Background:
I have a survey that is heavily modified by JavaScript (very much Frankenstein-ed together). I have a loop and merge set up (like 50 loops) that fills in data from previous years and skips the blank loops. So if in the previous year the person answered 4 loops, 4 loops are prefilled with their data, they update the info, and the remaining 46 loops are skipped with display logic.
The Task:
I would like to find a way to hijack the TOC functionality so that in addition to/instead of displaying blocks, it also displays loops that I determine should be seen 1_qid62, 2_qid62, etc. I have managed to add the framework in the header for a beginning custom ordered list but it just inherits the properties of the block, which is fine mostly but I don't know how to redirect the custom list item to a specified loop. When i inspect the link on the toc the anchor is
'<'a id="FL_L3" href="#"'>'.

Do I need to add a custom anchor to the Toc as well or am I in way over my head. The reason I'm even attempting this insanity is become in some cases some of the participants come close to using all 50 loops and sometime they have to jump around or come back to a specif loop to update information.

'<'script type="text/javascript">
Qualtrics.SurveyEngine.addOnload(function()
{
if($('Toc')){
var node = document.createElement("ol");
var textnode = document.createTextNode("Property1");
node.appendChild(textnode);
document.getElementById("FL_L3").appendChild(node);
}
});
</script'>'
icon

Best answer by TomG 19 December 2018, 16:44

View original

9 replies

"Buzz Lightyear to Star Command. Come in Star Command. Why won't they answer."
Userlevel 7
Badge +27
You may find the answer beyond infinity 😘
On a serious note this does seem to be very complicated that may be the reason it is not been answered.
I figured that would be the case. No harm in trying though 😶 I suppose I'll have to figure it out on my own. If I do figure it out I'll come back here and let you guys know how I did it.
@Mohammedali_Rajapakar_Ugam You recently helped someone take advantage of the TOC Jump feature to allow them to jump to the end of/a specific block. HERE. Do you have any thoughts on how I could accomplish this while jumping to a specific loop within a loop and merge?
@TomG you recently helped someone take advantage of the TOC Jump feature to allow them to jump to the end of/a specific block. HERE. Do you have any thoughts on how I could accomplish this while jumping to a specific loop within a loop and merge?
Userlevel 7
Badge +27
> @RDurant said:
> @TomG you recently helped someone take advantage of the TOC Jump feature to allow them to jump to the end of/a specific block. HERE. Do you have any thoughts on how I could accomplish this while jumping to a specific loop within a loop and merge?

You can't use a TOC to go to a specific Loop in a Loop & Merge. A TOC contains blocks and a Loop & Merge is a single block. So to a TOC, a Loop & Merge is just another block.

I don't completely understand what exactly you are trying to accomplish, but in order to jump to specific "loops" from a TOC, I think you would have to break the loop into separate duplicate blocks (i.e., not loop)
@TomG I am trying to figure out a way my survey participants can skip to specific loops when they need to. They are updating data we collect in previous years from an annual study. I thought the TOC may help me achieve that, but it would appear that is unlikely at this point given how you've explained it to me. Given the complexity and potential size of the survey splitting each loop into it's own block would make managing it a nightmare. I will keep your suggestion in mind though. Below is just a bit more on what I am doing with the survey.

A single loop consists of 20ish data fields plus two matrices(8 columns, 8+ rows, varied data types). Multiply that by 20 to 130 potential loop iterations. It makes for a lot of data all of which need to have the results from the previous years filled in. I've accomplished what i have so by using a 3 Dimensional array instead of the hundreds or thousands of embedded data fields I would need to accomplish what I have.
Userlevel 7
Badge +27
@RDurant,

I don’t know if this will help, but a way to control which loops get executed is to loop based off displayed choices in a previous question. In that previous question use choice display logic. Often you would want to hide the question with JS since it’s only purpose is to apply logic to the loop.
@TomG Oh, I'll have to look into that. It may prove useful yet. I'm already putting it together in my mind... Thank you for all of your help!

Leave a Reply