Good morning all :coffee:
My example base - a score board :joystick:
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;
With the JSON body data of;
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;
"Return": "Bazza of House Red: 1000",
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.
As a side note, thank you for this API tool; https://codepen.io/airtable/pen/MeXqOg I couldn’t have got this far without it.