Feb 22, 2019 08:45 AM
Good day Airtable community!
I built a table to track a list of our company’s mobile devices, and since I’m new here and the previous regime had nothing documented, I built a form for users to submit their own info on company cellphones and tablets.
Today I noticed that the SIM # field, which is an “Integer” type, is automatically rounding off my numbers. For example, (and this is a made up SIM number)
8912230100025277410 is automatically changed to
8912230100025277000
Why would it do that? How can I make it stop? I realize I can change this to a text field but I’d rather make sure that people are inputting numbers into it. I’d also like to not have to ask the 20 or so people who have already filled out the form to look up this information again, so if there’s any way I can restore what they had typed in, that would be preferable.
Also is there a maximum size of integer? Because if so, I can’t find it in any documentation.
Thanks for reading this!
Feb 22, 2019 07:30 PM
I’m also not aware of a maximum integer size, but a quick test definitely shows that there must be one, as you’re also finding.
I suggest using a text field, and testing to ensure that the entered number only contains numeric characters. Add a formula field to the table where this data is being captured. Obviously this wouldn’t prevent alphabetic characters from being entered into the form, but would give you a quick visual indicator when someone has done it. Here’s what I suggest (assuming your field is named SIM):
UPPER(SIM) = LOWER(SIM)
If the SIM field has any alphabetic characters, this will return a 0. Otherwise it returns a 1. You could even customize this more like so:
IF(UPPER(SIM) = LOWER(SIM), BLANK(), "ERROR!")
For fun, replace “ERROR!” with your favorite emoji: :rage: , :stop_sign: , etc. Something that sticks out to let you know there’s an error.