Select to view content in your preferred language

Survey123 -- calculation in constraint

1521
2
Jump to solution
01-09-2017 10:18 AM
KendraStraub
New Contributor II

Hello, 

I have multiple integer fields that represent percentages. My user would like to only allow 5% percent classes, e.g., 0, 5, 10, 15, 20...

How would you best write a constraint for this? I would rather not create a select one for something like this. 

Thanks in advance! 

1 Solution

Accepted Solutions
JoeFlannery
Regular Contributor II

Or, this is cool!

  constraint="(. mod 5) = 0"

From this web page:

Open Data Kit » Binding 

View solution in original post

2 Replies
JoeFlannery
Regular Contributor II

Or, this is cool!

  constraint="(. mod 5) = 0"

From this web page:

Open Data Kit » Binding 

KendraStraub
New Contributor II

This worked perfectly! Thank you!