Solved
Javascript display logic for matrix table: hide row conditional on answer being piped in
I have a matrix table to which I'm piping in responses from several prior multiple choice (single response) questions. When a person answers anything other than "I don't know" to the prior questions, it works fine. However, when the person answers "I don't know" to any of those questions, I do not want the "I don't know" as a row to which the person can respond in the matrix table. In other words, I want the matrix table to only show rows for those questions to which a person did not give an "I don't know" answer. (So the number of rows will vary depending on the number of the person's "I don't know" answers to the prior questions.) I tried using display logic on the rows so that the rows would only display when "I don't know" was not selected, and this did hide the wording "I don't know," but the problem is that it did not hide the row itself so that now the row itself with the radio buttons is still there but it has no wording associated with it. How can I get rid of the whole row, including the radio buttons, when a person answers "I don't know" for that particular item? I think I need to put Javascript in. I tried the below from bits and pieces I got off the internet, but obviously it didn't work. I also need to include this snippet in there too jQuery(".choiceText").hide(); but I'm not sure where or how to include it. (This part does work.) Thanks for any help you can provide!
if ('${q://QID88~93/ChoiceGroup/SelectedChoices}'= ‘I don't know’)
{jQuery(("#QR~"+this.questionId+"~"+cell).replace(/~/g, "\\\\~")).closest("td").find("*").hide();}
Best answer by TomG
> @ResearchPsychologist said:
> Oh, I'm sorry: I misspoke. I do have "IS NOT SELECTED." The red circled area is where I chose "I don't know" on one of those previous questions and while the words "I don't know" are not displayed, as you can see, the row still is. See below
>
> !
>
> !
That looks like you didn't force response on one or more of the previous questions so a blank item (no answer) is being piped. If I'm correct, an easy solution is to turn on force response on those questions.
>
> !
That looks like you didn't force response on one or more of the previous questions so a blank item (no answer) is being piped. If I'm correct, an easy solution is to turn on force response on those questions.Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

!
!
!
!
!
!
!
UPDATE: I'm certain now that it's something to do with how I set the embedded data and that I've isolated where the problem is occurring, though I still can't solve it. When I take out ALL JavaScript and just use survey flow to create embedded data with the response choices from the prior questions (e.g., country1 = ${q://QID93/ChoiceGroup/SelectedChoices}, etc.) and then pipe in the embedded data into the new question's response choices (e.g., answer choice 1 = ${e://Field/country1}, it's not showing anything in preview for any of the response choices (as shown in the final image above). However, if I create a question where I'm just directly piping in the response choices from the prior questions (e.g., ${q://QID93/ChoiceGroup/SelectedChoices}, instead of piping in embedded data and setting the embedded data, e.g., ${e://Field/country1}, as the response choices from the prior questions), it works. However, I cannot do the question this way as I am unable to de-dupe the piped in response choices. (So instead, as TomG advised, I have to construct an array, de-dupe, and set the embedded data from a loop and pipe it back in. Or is there another way?)