How do I write a WeChat article to Feishu Base without creating duplicate records?
To write a WeChat article to Feishu Base without duplicate rows, fetch the article with wechat_mp.v2.fetch_article_detail_h5, generate record-fields.json with prepare_feishu_fields.py, preview the write by running lark-cli base +record-upsert with --dry-run, and create one row. Save the returned record ID, and pass that record ID as --record-id on every later update: lark-cli base +record-upsert without --record-id creates a new row and does not look up existing rows by Article URL. Read the row back with lark-cli base +record-get and check that the article link opens and each value sits in the right column.
Give teammates separate columns for selection reasons, review status and findings, so later updates of the four index fields leave the teammates’ work in place.
Decide what the record should help the team do
For example, for peer product announcements, verify the product and version, keep the article link, title and account, and then add the research question, the selection reason and the unresolved conditions by hand. The WeChat article is source material. A promotional claim in the article is not a verified team conclusion.
prepare_feishu_fields.py below writes only four fields: Article URL, Title, Account ID and Request ID. Reading status, theme, selection reason, owner and analysis do not come from the API. To track those values, confirm writable columns in the table and fill the columns by hand, or design a separate mapping. A name in an owner column does not mean the named person accepted the assignment.
Check what each stage actually establishes
Mark the local article-to-record-ID mapping complete only after a correct readback. Leave unavailable values out of record-fields.json, so an update does not clear existing cells. Resolve long and short URL aliases of the same article before treating two URLs as different articles. Matching titles do not identify the same article.
Help colleagues continue the research
Keep the original article link and human states such as pending reading, reviewed and more evidence needed. For each judgment, record the evidence and the next step. An indexed row does not mean the article was read or the question resolved. For body reading, use the saved article or the original page; do not put a long article into a cell whose type and length limits you have not checked.
Before creating a row, check that the table does not already contain the article. On update, write only the verified fields and keep colleagues’ analysis and annotations. lark-cli base +record-upsert writes one record and does not enforce a unique business key, so multiple writers and scheduled jobs need their own concurrency and duplicate coordination.
Steps 1–6 below cover field verification, field-file preparation, dry-run, creation or update, and readback. Native Feishu automation, scheduled account checks, and group-bot notifications are separate tasks; this write workflow does not configure Feishu automation, scheduled checks, or notifications.
For example, a teammate tagged “Installation manual update” as “Verify the new entry point.” If you confirmed only the title and the URL, update those two fields on the known record ID and leave the teammate’s note in place. On readback, fetch the row by the same record ID and check that the URL and the note still belong to the same article.
1. Reuse a saved article or retrieve one body
Inspect data:wechat_mp.v2.fetch_article_detail_h5 with the free /v1/capabilities/inspect endpoint. Running the action consumes balance; reuse a saved successful result instead of fetching the same article again.
Generate wechat-article-source.json with the article-reading guide. article_url identifies the current article, not the author’s source_url. When the response has no link, the source exporter takes the link from the validated request URL and records where the link came from in article_url_from. The Feishu row stores an index of the article, not the long article body.
2. Resolve the confirmed target table
Install and authorize the Feishu CLI (lark-cli), then check the local version and the command help; this guide uses version 1.0.89. Do not switch identity to get around permissions, and do not expose tokens.
Pass the base_token and table_id that +url-resolve returns. A spreadsheet sheet_id or a BaseApp app_token cannot replace base_token and table_id.
3. Verify writable text fields
The example expects four existing text columns in the table: Article URL, Title, Account ID and Request ID. Check the column names and types with +field-list, and adapt the mapping in prepare_feishu_fields.py to your table. Do not create, rename or delete fields as a side effect. Formula and system fields are not ordinary text cells.
The Python script below only writes a local field file and does not call Feishu. Missing optional values are left out instead of being sent as null, so existing cells are not cleared.
lark-cli base +record-upsert expects the field map at the top level of record-fields.json, without a fields wrapper. The CLI input is not the same as a native Feishu OpenAPI request body.
Save the code as prepare_feishu_fields.py and run python3 prepare_feishu_fields.py. Open record-fields.json before the preview: the file contains the index fields only, not the article text or your API key.
To store the publication time, first confirm one more writable text column, then add ("published_at_utc", "Published UTC") to the mapping. Keep the ISO timestamp as text; a datetime column takes a different CLI value format, so do not send the ISO text to a datetime column. Apply the same rule to collected_at, and label the collected_at column as collection time, never as publication time.
4. Preview before approving a write
Check the destination table and the values in the dry-run output. Remove --dry-run only after the write is approved. Keep authorization secrets out of article prompts.
5. Upsert is not automatic article-key deduplication
Without --record-id, lark-cli base +record-upsert creates a record; with --record-id, the command updates that record. The command does not search the Article URL column. After a successful create, save the verified mapping from article key to record ID, and pass that record ID for updates:
Before a reimport, check the saved mapping and the destination table. If the mapping is lost, look up the existing records instead of creating the row again. Short and long URL aliases and concurrent runs need their own identity and coordination rules; the name “upsert” does not mean a unique business key.
After an approved create or update, read back the exact returned record with lark-cli base +record-get before you mark the local article mapping complete:
If you added optional date columns, add those column names to the --field-id list in the readback too. Compare the returned URL and values with record-fields.json. A timeout without a returned record ID does not prove the record was not created: check the destination table before retrying, and do not create a second row only because the local mapping is missing.
6. Verify failures and updates
Treat CLI exit code 0 or ok=true as success; the native API’s historical code=0 convention does not apply to lark-cli. Keep the record ID the CLI actually returned and check that the record is the intended one. If a write times out with an unknown outcome, check the table before repeating the creation.
If the write fails on permissions, fix the authorization or the table permissions for the intended identity. A generated record-fields.json is not a completed write. For periodic updates, use incremental discovery; scheduling, notifications and full-text storage are separate tasks.
Reference: lark-cli 1.0.89 command help and the Feishu record documentation.

