Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Dynamically hide null responses

Raffe
Level 2
Level 2

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

1 Accepted Solution
Raffe
Correct answer by
Level 2
Level 2

Hi Radzmar

Thank's for this, it's exactly what I was looking for. Works perfectly.

View solution in original post

2 Replies
radzmar
Level 10
Level 10

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;

Raffe
Correct answer by
Level 2
Level 2

Hi Radzmar

Thank's for this, it's exactly what I was looking for. Works perfectly.

View solution in original post