Dynamically hide null responses

Raffe

15-11-2017

Hi all.

A bit of help with this problem I am having with the attached form.

Ideally with this form I would like to have my responses from my questions summarized under the appropriate header. 

So if the answer to the asked question is clicked as NC (Non-compliant) all NC answers will be listed under the text field labeled NC. This should follow for questions responses to PC too.

The way I have been doing it in the past is through "this.rawValue = Q1.Table1.Row1.TF2.rawValue + "\n" + Q1a.Table1.Row1.TF2.rawValue" for all my questions, with the result in my header text field is listed full of nulls. At the end of the process I then manually delete the nulls, leaving just the correct responses. This is rather tedious and time consuming and not very user friendly.

I have requested some help with this question in the past and the solution provided worked, but up to a point, only if i had 2 variables. I have tried to adapt the solution provided to cover multiple questions, but unfortunately no luck with my coding. My hacked solution is under the PC header text field.

So if anyone can help provide a solution to my problem that would be greatly appreciated.

Linked file Dropbox - Test removing nulls 2017-11-14.pdf

Answers (1)

Answers (1)

radzmar

MVP

20-11-2017

The script for the field at form1.#subform[0].EXNC should look this way to exclude null values:

var cResult = ""

cResult += Q1.Table1.Row1.TF2.isNull ? "" : Q1.Table1.Row1.TF2.rawValue + "\n";

cResult += Q1a.Table1.Row1.TF2.isNull ? "" : Q1a.Table1.Row1.TF2.rawValue + "\n";

cResult += Q1b.Table1.Row1.TF2.isNull ? "" : Q1b.Table1.Row1.TF2.rawValue + "\n";

cResult += Q1c.Table1.Row1.TF2.isNull ? "" : Q1c.Table1.Row1.TF2.rawValue + "\n";

cResult += Q12.Table1.Row1.TF2.isNull ? "" : Q12.Table1.Row1.TF2.rawValue + "\n";

this.rawValue = cResult;