There’s a neat trick that not too many casual Airtable users know about - where by configuring filters within a new view that’s filtered to Single Select column(s), that new records created under that view will default to the filtered value(s). Very handy!
Have the Single Select Field (or more)
Create the View
Filter that View to Single Select colums
New records created default to those values.
My question - is it possible to POST a record to a targeted View? Obviously the API calls for the Base ID and Table target, but I can’t find anywhere that details the syntax, or even mentions if it’s possible to utilize a view within that table for record creation via API.
To log a new score (using Postman to learn with), I have this;
Interestingly, I notice that it calls the View Name/ID where it’s stated on the API CodePen site “Only records in that view will be returned” - but confusingly, my experience is that I post a record and the details of that record (such as calc’d fields) are returned, regardless of the view specification. Regardless of if the record lands in the view, or the view has all fields hidden, the return is very complete;
Further to the above return, if I create a record that is filtered OUT of that specified view, I’d expect my Post return to be empty (even though the record created). In short - I would expect Record recwln2xp65CbhqfS to only return if it had the filtered Status match.
Below shows the result of the newly created record - without the default Status “New” value I’m hoping to achieve. :cry:
I’m hoping this is possible, as it will mean much of my template data can reside within the Table itself under pre-configured views, meaning that data won’t have to be created and sent at the app level as JSON (which will be my first go-to workaround for this problem - as automating default values won’t provide the instant return).
Keen to read thoughts around this. I did search for past discussions but couldn’t find any that were talking about this in particular.
No. It is not possible. When using the REST API, there is no context of an active view the way there is in the user interface.
The feature of having defaults set when creating in a filtered view only works in the user interface. Note that if you have records grouped only by editable fields, you also get the same effect.
If you create a record with the “+” in the lower left corner, note that the record is not created “in the view” and thus might be immediately filtered out and disappear as soon as the focus leaves the record.
This is the designed behavior, although it is not expected by some users. The visible fields in the view do not affect which fields are returned. The only aspect of the view that is used for REST API GET requests is the filtering.