Help

Formula is Number or String despite formatting set to Integer

Topic Labels: Base design
1377 7
cancel
Showing results for 
Search instead for 
Did you mean: 
Jacob_Leander
4 - Data Explorer
4 - Data Explorer

Hi all,

Might be a rookie mistake but I have a formula with this:
IF(DATETIME_DIFF(TODAY(), {Full-date}, ‘days’)>10,1,0)

It is set to integer but despite this the API is Number or String, causing other problems such as having to put my API request in “1”. Other fields that are set to integer is simply Number in the API. Any way to force the formula to be number or am I making some other mistake?

Jacob

jloscreenshot 2020-09-05 at 21.08.10@2x

jloscreenshot 2020-09-05 at 21.08.40@2x

7 Replies 7
Jacob_Leander
4 - Data Explorer
4 - Data Explorer

Any thoughts on what I am missing? :slightly_smiling_face:

Seems like a bug. I would report it to support@airtable.com, but I wouldn’t hold your breath on them fixing it. They’re very bad about responding to bug reports & feature requests.

However, is it really causing a problem? I’ve been using the API with formula fields that result in integers for years, and I’ve never had a problem. I’ve also never needed to wrap my numbers in quotation marks.

Jacob_Leander
4 - Data Explorer
4 - Data Explorer

Will give it a try :slightly_smiling_face:

I will give it a shot again but that is what fixed it and assumed it was connected with that. Another field that was Integer only didn’t have that issue…

Yeah, if that fixed the issue for you, then I would just run with it. What I meant above is: is it really a problem if you have to put quotations around the number 1? I haven’t had to do it on my end, but if you need to do it on your end, it doesn’t sound like it’s that big of a deal, no?

It is doable and solves it, but it just goes against my gut feeling of solving it in Airtable instead :slightly_smiling_face:

You could try dropping the surrounding IF() function, and just use this:

DATETIME_DIFF(TODAY(), {Full-date}, 'days') > 10

A condition on its own automatically returns 1 for true, 0 for false.

Just tried it and unfortunately not. Even tried creating a new column and same issue there. Output in API documentation is either Number or String…?
jloscreenshot 2020-09-08 at 07.25.11 jloscreenshot 2020-09-08 at 07.24.58