I have a text entry question that is in a block of my survey that is looped. Is it possible to use JavaScript to set an embedded data field that gives a count of the number of non-empty responses there are for that question?
Instead of JS, we can use branch logic and Math operation to set the embedded data.
As a non-code, non-branching fallback, I could create a hidden question that lists every text box in the survey, then use answer choice display logic to display if not empty, and check all displayed answers with js. I can do that, but it means making a list of about 1000 items since each loop’s questions would need to be done individually. I’d really rather find a way to increment a count in js and keep it in a field instead of adding another thousand columns to the dataset (it’s already too many columns to view it in the Data & Analysis tab, and I can’t download in Chrome because of header limits, so I already have to open Firefox to download the data each day). Any suggestions or pointers to tutorials/starting points/sample code would be greatly appreciated.
Thanks!
Never mind, I figured out a way by cobbling together pieces of code from other related scenarios. :)
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.