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

Calculate items do not store logical values

Open jmgirard opened this issue 5 years ago • 4 comments

I am having trouble getting a calculate type item to store logical values (i.e., TRUE or FALSE).

A minimum working example is here: https://docs.google.com/spreadsheets/d/14x1TtDJH0J2ivvuf7r7kK-9_ZdQd1ycyzk5kZ2TBp4g/edit?usp=sharing

jmgirard avatar Oct 17 '19 19:10 jmgirard

The plot thickens. It seems that the issue is only with storing FALSE logicals, as TRUE values seem to be converted to 1's successfully:

Config image

Input image

Output image

Note the missing values for the two FALSE items. They aren't NA, just missing entirely.

jmgirard avatar Oct 17 '19 21:10 jmgirard

Dear Jeffrey

Thanks for reporting the issue. We will resolve this in the next release. For the moment please could you use your workaround?

best Cyril

On Thu, Oct 17, 2019 at 11:32 PM Jeffrey Girard [email protected] wrote:

The plot thickens. It seems that the issue is only with storing FALSE logicals:

Config [image: image] https://user-images.githubusercontent.com/6829033/67049253-c8594400-f103-11e9-8bd4-6e3917f18c4f.png

Input [image: image] https://user-images.githubusercontent.com/6829033/67049380-15d5b100-f104-11e9-8cd2-44e5758667c1.png

Output [image: image] https://user-images.githubusercontent.com/6829033/67049221-b4addd80-f103-11e9-8236-75d540ca146d.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rubenarslan/formr.org/issues/428?email_source=notifications&email_token=AARL5Z5J3BXPW7S5Y4OVUH3QPDKX5A5CNFSM4JB6E4KKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBRS4XQ#issuecomment-543370846, or unsubscribe https://github.com/notifications/unsubscribe-auth/AARL5Z4QIMWRAJB2BYJJOWTQPDKX5ANCNFSM4JB6E4KA .

cyriltata avatar Oct 18 '19 07:10 cyriltata

Sounds good. Thank you!

jmgirard avatar Oct 18 '19 14:10 jmgirard

To explain this a little, the calculate fields always store text. So all you ever get is a text representation of the value. But I think we're doing the conversion on the PHP side (where an empty string can denote false), when we should probably be doing it on the R side with as.character to keep things consistent (in R an empty string is NA, not false).

rubenarslan avatar Oct 24 '19 17:10 rubenarslan