Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here
Jul 15, 2022 10:05 AM
Hi everyone, can you tell me how to convert a checkbox column into numbers? where the cells with the check become 1 and the cells without the check become 0.
I tried to do it but it puts all the empty column back, while on the contrary from numbers to checkbox it seems to work
Jul 15, 2022 11:25 AM
Hey @Brock!
Welcome in!
So, it’s a question of data types.
The checkbox takes a boolean, either as a truthy or falsy.
Airtable will take your 1
or 0
and use type coercion to convert it into a boolean.
The same is not true for converting booleans to numbers.
That’s why you’re not getting any values, as Airtable won’t coerce a boolean into a number value, even though 1
& 0
sometimes represent a boolean.
I think that’s where the confusion comes from.
I’m not too sure exactly how you’re trying to convert your field, but here’s what I would do if I needed to convert a checkbox field to a number field.
Simply group or filter your records based on the checkbox value.
And then just flat out paste a 1
into the number field for that entire group/view.
Do the same for the falsy group, then just delete your checkbox field.