popo-excel-export
SKILL.md
POPO Excel Export
Export 协作表格/多维表格 from POPO Docs to local .xlsx files using the internal export API.
Prerequisites
- OpenClaw browser logged into POPO Docs
- User must have export permissions
Supported Document Types
- Lingxi documents:
/lingxi/...→ uses lingxi export API (POST) - Team spreadsheets:
/team/pc/.../pageDetail/...→ uses team space export API (GET)
Workflow
Step 1: Navigate to Document
browser action=navigate profile=<profile> targetUrl=<popo_doc_url>
Wait 4 seconds for page load.
Step 2: Run Export Script
browser action=act profile=<profile> request={
"kind": "evaluate",
"fn": "<contents of scripts/export.js>"
}
The script automatically:
- Detects document type (lingxi or team)
- Extracts required IDs
- Calls appropriate export API
- Polls task status until complete
- Returns download URL
Step 3: Download
curl -L -o "<filename>.xlsx" "<download_url>"
Step 4: Read Excel (Check All Sheets)
import pandas as pd
xl = pd.ExcelFile('file.xlsx', engine='openpyxl')
print('Sheets:', xl.sheet_names)
for sheet in xl.sheet_names:
df = pd.read_excel(xl, sheet_name=sheet)
print(f'{sheet}: {len(df)} rows')
API Reference
Lingxi Documents
| Step | API | Method | Params |
|---|---|---|---|
| Export | /api/bs-doc/v1/document/lingxi/export/new |
POST | docId (query) |
| Poll | /api/bs-doc/v1/task/{id} |
GET | id (path) |
Team Spreadsheets
| Step | API | Method | Params |
|---|---|---|---|
| Export | /api/bs-team-space/web/v1/page/export |
GET | pageId, teamSpaceId (query) |
| Poll | /api/bs-doc/v1/task/{id} |
GET | id (path) |
Troubleshooting
| Problem | Solution |
|---|---|
| "Unknown document type" | URL must contain /lingxi/... or /team/pc/.../pageDetail/... |
| "Could not extract teamSpaceId" | Refresh page or check permissions |
| API returns 401/403 | Re-login to POPO Docs |
| Timeout | Large file, increase poll retries |
| Download URL expired | URL valid ~30 min. Re-export if expired |