-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update won't work with formula/lookup fields in the table #8
Comments
Another note that I forgot to add: the Airtable API allows for PATCH in addition to PUT:
However this gem appears to be converting all updates to PUT requests that post all of the fields. Perhaps on update it would be better to check whether all fields are being updated, or just a subset, and then issue the according PATCH/PUT. This would likely solve the problem of not being able to update formula/calc fields. Hope that helps. Thanks again! |
Thanks Donald! That makes sense. There are two conflicting objectives that we'd need to First is that the API should accept back any value that it returned. You Second objective is to protect API users from unexpected data loss and The solution is probably to ignore computed fields submitted to the API for Eventually we might provide the list of the computed fields to the client. Alex On Saturday, May 7, 2016, Donald Merand notifications@github.com wrote:
Sent from Gmail Mobile on my iPhone |
yeah, the record could keep track of changed fields and then the update method on table could PATCH only changed fields. |
This is not a complete solution to computed fields, but I added update_record_fields method to table (on master) |
While a "complete" solution would be aesthetically pure, I can say that my needs are met perfectly by the |
I am not a big fan of having two paths into updating fields. Why not always use I just ran into this issue an hour ago, and didn't realize this method existed for example :) |
I know this is 3 years old, but does this Gem support It's kimpossible to update a record in my scenario, because there's absolutely no chance that I will ever have the ID of the record I am trying to update. |
Hi,
I was having a ton of problems getting an existing record to update, and then I found this line in
lib/airtable/records.rb
:It turns out that Airtable will complain if you've got any calculated fields in the table, and it won't update :/
What I've done to fix this in my code is a monkeypatch like this:
... but I wonder if there's a more elegant way to do this?
The most elegant way to fix it would be if Airtable didn't FAIL when you try to update a calculated field (or the ID), but merely sent along some kind of warning. I'll send this idea along to them as well.
Thanks!
-Donald
The text was updated successfully, but these errors were encountered: