Multiple boolean fields with only one True

Hi folks!

I wonder if it’s possible to have a set of boolean fields where only one per row can be true, with all others false? I started out trying something like

if field1 = true then false else …

But find myself struggling to work out what would follow that, whilst keeping an even distribution of true/false across all fields.

Essentially what I’m trying to emulate is a list of questions in an assessment where the person being assessed can only answer “Yes” (true) to one of the questions.

Am I attempting the impossible? Any help appreciated!

Here you go: http://mockaroo.com/a6a654f0

I use a hidden field called “__yes” which generates a random number from 1 to 3, then set the value of the corresponding question field to true.

That is so simple it’s almost embarrassing I didn’t think of it…

Thank you - you’ve saved me many hours of manually creating mock data!

This is great… but what about where I have a JSON Array where one of the rows needs a true item and the others should be false?