Skip to content

Conversation

@Xheldon
Copy link
Contributor

@Xheldon Xheldon commented Nov 28, 2025

issue #455

This PR’s initial submission only implements the basic functionality; formula, Rollup, Lookup, and other related properties have not been properly handled yet. These features will be fixed in later code commits.

If anyone is willing to try this PR, please be sure to back up your Vault.

Some of the code was generated by AI. I have reviewed and tested it myself, but there are parts that need refactoring. I will continue to optimize the code in subsequent commits and will request the author’s review when the timing feels right.

@Xheldon Xheldon changed the title Support Airtable API(WIP) #455 Support Airtable API(WIP) Nov 28, 2025
@kepano kepano requested a review from tgrosinger November 28, 2025 16:56
@tgrosinger
Copy link
Contributor

I see Kepano added me as a reviewer, but based on the description I will hold off until I hear from Xheldon saying that it's ready. Looking forward to trying it out!

@Xheldon
Copy link
Contributor Author

Xheldon commented Dec 7, 2025

I think I’ve finally finished this task, the code is ready for review! @tgrosinger

I tested importing the Base that @kepano shared with me, which contains multiple tables with nearly 3,000 records, and it runs perfectly😎

@Xheldon Xheldon changed the title Support Airtable API(WIP) Support Airtable API Dec 8, 2025
@Xheldon
Copy link
Contributor Author

Xheldon commented Dec 8, 2025

It looks like, due to my mistake, I mixed in dirty history. After cherry-picking all necessary changes, I resubmitted a new version.

Refer to the Notion API workflow to implement basic interfaces such as a directory tree (Base/Table) selection.
Refer to the CSV import workflow and display the field template configuration interface.
* Add incremental import toggle
* Add Base link field setting
* Cache certain API requests
* Make the Note location setting in CSV templates configurable (since we’ve already created folders by Base/Table)
Considering that Airtable’s API offers only a few request types (listing bases, fetching a table schema, retrieving view records), I split the import process into two parts: process the data first, then write it to files.

The import process is now divided into two stages:
Stage 1: Retrieve the records of all tables in all bases, along with the corresponding view data, and build the correct content, references, formulas, etc.
Stage 2: Write the files, including all view information into a .base file (checking for existing files before writing).

Note that any error in Stage 1 will abort the import.
Properly handle attribute conversion
Properly handle formula conversion (WIP)
* The field order now matches the order of fields in Airtable
* Check the Text function conversion logic one by one to ensure it is correct.
* Correctly handle rename logic
* Handle illegal string filename logic
* Correctly handle error flow
* Proper handling `=` the differences between Airtable and Obsidian
* remove legacy parameters
* Use the same directory tree style class names as the Notion API
* Remove unused functions
* Remove unused parameters
* Extract function parameters of five or more into types
* Special handling for Currency and Rating types
* Handle type issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants