-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Fix: pass returnFieldsByFieldId to getRecord for Airtable actions #16391
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
base: master
Are you sure you want to change the base?
Fix: pass returnFieldsByFieldId to getRecord for Airtable actions #16391
Conversation
@SokolovskyiK is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes update the Airtable OAuth "Get Record" action by adding a new Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GetRecordAction
participant CommonActions
participant AirtableApp
User->>GetRecordAction: Invoke with returnFieldsByFieldId
GetRecordAction->>CommonActions: Call getRecord(ctx)
CommonActions->>AirtableApp: getRecord({ baseId, tableId, recordId, opts: { returnFieldsByFieldId } })
AirtableApp->>AirtableApp: Make HTTP GET request with query param
AirtableApp-->>CommonActions: Return record data
CommonActions-->>GetRecordAction: Return record data
GetRecordAction-->>User: Return record data
Assessment against linked issues
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
components/airtable_oauth/actions/create-multiple-records/create-multiple-records.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/airtable_oauth/actions/create-field/create-field.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs components/airtable_oauth/actions/delete-record/delete-record.mjsOops! Something went wrong! :( ESLint: 8.57.1 Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'jsonc-eslint-parser' imported from /eslint.config.mjs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (24)
✅ Files skipped from review due to trivial changes (24)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @SokolovskyiK I've just added a minor request change on the component version. Also keep in mind that we need to increase the version in components/airtable_oauth/package.json
to 0.4.5
Also because you've touched a common file you need to increment following ones as well:
# MacOS
sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/create-comment/create-comment.mjs && sed -i '' 's/0.1.2/0.1.3/' components/airtable_oauth/actions/create-field/create-field.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/create-multiple-records/create-multiple-records.mjs && sed -i '' 's/0.1.2/0.1.3/' components/airtable_oauth/actions/create-or-update-record/create-or-update-record.mjs && sed -i '' 's/0.0.11/0.0.12/' components/airtable_oauth/actions/create-single-record/create-single-record.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/create-table/create-table.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/delete-record/delete-record.mjs && sed -i '' 's/0.0.12/0.0.13/' components/airtable_oauth/actions/get-record-or-create/get-record-or-create.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/list-records/list-records.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/list-records-in-view/list-records-in-view.mjs && sed -i '' 's/0.0.12/0.0.13/' components/airtable_oauth/actions/search-records/search-records.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/update-comment/update-comment.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/update-field/update-field.mjs && sed -i '' 's/0.0.11/0.0.12/' components/airtable_oauth/actions/update-record/update-record.mjs && sed -i '' 's/0.0.10/0.0.11/' components/airtable_oauth/actions/update-table/update-table.mjs && sed -i '' 's/1.0.2/1.0.3/' components/airtable_oauth/sources/new-field/new-field.mjs && sed -i '' 's/0.0.11/0.0.12/' components/airtable_oauth/sources/new-modified-or-deleted-records/new-modified-or-deleted-records.mjs && sed -i '' 's/0.1.2/0.1.3/' components/airtable_oauth/sources/new-modified-or-deleted-records-instant/new-modified-or-deleted-records-instant.mjs && sed -i '' 's/1.0.2/1.0.3/' components/airtable_oauth/sources/new-or-modified-field/new-or-modified-field.mjs && sed -i '' 's/1.0.2/1.0.3/' components/airtable_oauth/sources/new-or-modified-records/new-or-modified-records.mjs && sed -i '' 's/0.0.12/0.0.13/' components/airtable_oauth/sources/new-or-modified-records-in-view/new-or-modified-records-in-view.mjs && sed -i '' 's/1.0.2/1.0.3/' components/airtable_oauth/sources/new-records/new-records.mjs && sed -i '' 's/0.0.11/0.0.12/' components/airtable_oauth/sources/new-records-in-view/new-records-in-view.mjs && sed -i '' 's/0.1.2/0.1.3/' components/airtable_oauth/actions/create-or-update-record/create-or-update-record.mjs && sed -i '' 's/0.0.11/0.0.12/' components/airtable_oauth/actions/create-single-record/create-single-record.mjs && sed -i '' 's/0.0.12/0.0.13/' components/airtable_oauth/actions/get-record-or-create/get-record-or-create.mjs && sed -i '' 's/0.0.11/0.0.12/' components/airtable_oauth/actions/update-record/update-record.mjs
Let me know if you can do that otherwise I can do it for you thanks!
Co-authored-by: Jorge Cortes <jacortesmahmud@gmail.com>
@jcortes Hi. Sure let me do this. |
@jcortes Done! Hopefully I didn’t mess anything up =) Let me know if anything else is needed — happy to adjust. |
Fixes #16317
I opened both actions:
Both use the shared getRecord() method from commonActions.mjs.
I noticed that returnFieldsByFieldId was not being passed to the API when fetching a record — unlike updateRecord(), which correctly includes it via the opts parameter:
I inspected getRecord() and found the issue:
I suspected .find() might not support query parameters, so I checked the Airtable SDK (table.ts) and confirmed:
These wrap two different functions:
Since _findRecordById does not accept opts, and .find() simply wraps it, there's no way to pass returnFieldsByFieldId using the SDK method.
What I did to fix it
I rewrote the internal getRecord() method inside the Airtable app (airtable_oauth.app.mjs)
to use this._makeRequest() instead of .find(), giving us full control over query parameters:
Then I updated commonActions.getRecord(...) to pass the returnFieldsByFieldId flag properly:
I also updated get-record.mjs to explicitly expose the returnFieldsByFieldId option to the user by adding it as a prop.
I did not need to modify get-record-or-create.mjs, as it already defined the returnFieldsByFieldId prop and passed this to commonActions.getRecord(...).
Result
When testing the updated actions, I confirmed that:
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Refactor
Chores