formr.org icon indicating copy to clipboard operation
formr.org copied to clipboard

get parameter unintuitive behavior

Open rubenarslan opened this issue 3 years ago • 3 comments

  • [ ] Apparently only works at the beginning of a run if a label column has content
  • [ ] Value cannot be referenced in a showif/label.

rubenarslan avatar Nov 22 '21 19:11 rubenarslan

To specify a bit:

  • If "get" is the first item of a run, it can be used with an empty "label" column.
  • If it appears somewhere within a run, for example, when returning from an external site to formr, the "label" column must contain some text.

(That's what we discussed in the Google group)

However, I did a little more testing and found some more unexpected behavior:

  • if the "label" column of the "get" call is empty (e.g., when using it at the beginning of the run) and no URL parameter is provided (i.e., by just accessing the study via mystudy.formr.org/ instead of mystudy.formr.org/?param=1), the value of the variable gets "".
  • However, if the "label" column of the get call contains text and no URL parameter is provided, the value of the variable gets NA.

Thus in one case I have to use is.na() and in the other case == "" to check if the variable is empty.

dgromer avatar Mar 30 '22 13:03 dgromer

Hi @dgromer apparently @cyriltata cannot replicate this problem following your verbal explanation. Could you provide a run export of your tests that clearly shows the bug?

rubenarslan avatar Jun 14 '22 17:06 rubenarslan

Here's a run that returns NA: https://get-url-parameter-test-label.formr.org/ And here's one that returns "": https://get-url-parameter-test-nolabel.formr.org/

One note: either the problem turned around or I described it the wrong way around the last time. The study with an empty "label" column returns NA, the one with text in the label column returns "".

Please find the JSON files of the runs including the study details here: get-url-parameter-test.zip

dgromer avatar Jun 22 '22 07:06 dgromer