Install
openclaw skills install sf-business-data-exportExport Salesforce business data into business-readable Excel files from natural-language requests. Use when pull large Salesforce datasets beyond Report limits, map layout-visible fields into readable exports, generate object-level SOQL, handle polymorphic relationship fields, traverse parent-child relationships, run two-step detail queries, export through SOAP with queryMore, or prepare review materials for business users.
openclaw skills install sf-business-data-exportInterpret the user's request as a data-export task, not just a query-writing task. Produce files that business users can review directly.
Current status: ready for limited real-world trial use.
Checklist conclusion:
scripts/ and references/: mostly passedCurrent strengths:
Known remaining gaps:
Recommended next step:
Convert the natural-language request into an export definition before writing SOQL:
If the request is ambiguous, prefer a conservative, review-oriented export that includes more context fields rather than fewer.
Normalize every request into explicit execution inputs before reading metadata or writing SOQL.
Required inputs:
Optional inputs:
Input fallback rules:
When current page-visible fields are used as the field baseline, resolve the page in this order:
Profile and record type rules:
Ambiguity handling for page resolution:
Execute in this order unless there is a concrete reason to deviate. Apply steps 3 through 8 per object when the request includes multiple objects.
query and queryMore.Flow rules:
Query strategy selection order:
OwnerId.referenceTo requires itFailure and stop conditions:
describe, Lightning page, FlexiPage, or Layout cannot be retrieved and no reliable fallback exists, mark the affected object as failedUse retrieved Lightning page metadata as the primary source for current page-visible fields when it provides usable field information.
If Lightning page metadata is unavailable or does not expose enough field information, fall back to Layout metadata.
Use FlexiPage metadata to identify page-specific field usage before falling back to Layout.
Do not assume Report columns are sufficient.
When building export columns:
Id, OwnerId, and lookup ids when they are useful for traceabilitydescribe results even if they appear in layout metadataPrefer Chinese labels for the final Excel header row when labels are available.
Choose the query pattern by object shape.
If OwnerId.referenceTo is only User, query owner fields directly, for example:
Owner.NameOwner.CRM_Sales_Team__cOwner.CRM_Sales_Group__cIf OwnerId.referenceTo includes both User and Group, do not rely on Owner.Custom_Field__c in WHERE.
Use this pattern instead:
OwnerId IN (SELECT Id FROM User WHERE ...)SELECT with TYPEOF Owner ...This pattern avoids failures like No such column ... on entity 'Name'.
If the current object does not expose owner or scope fields directly, determine scope from the parent object. Typical pattern:
CRM_Opportunity__cOpportunity.OwnerIf a detail object cannot be filtered cleanly in one SOQL query, use a staged approach:
IN (...)Use this approach for objects like order details when SOQL relationship filtering is too limited.
Export through Salesforce SOAP API using query and queryMore when result volume or column flexibility exceeds Report usefulness.
Do not stop at CSV if the user asked for business review output.
Generate .xlsx files with:
Treat the export as complete only when all requested objects have review-ready outputs and all validation checks pass.
Minimum required outputs:
.xlsx file for each exported object unless the user explicitly requests a different formatField coverage rules:
exported expected fields / total expected fieldsdescribe or inaccessible due to permissions and this is called out in the manifestRow count validation rules:
Object completeness rules:
Review-readiness rules:
Use this skill when the task is to turn a Salesforce business question into review-ready data exports rather than only produce SOQL.
Good fit:
Not a good fit:
When the request is ambiguous, prefer a conservative review-oriented export with more context fields, but do not claim success if requested objects, required fields, or validation outputs are missing.
This skill assumes the execution environment can both query Salesforce and produce review-ready files locally.
Required capabilities:
describe metadataLayout metadata for business-visible field selectionFlexiPage metadata when page-specific fields must supplement layout fieldsquery and queryMore.xlsx files locallyCurrent page field baseline:
Validation outputs are mandatory:
Every export result must be independently verifiable by a user reviewing the output package.
The result package must make the following visible for each object:
Completed work must be visible:
Incomplete work must be visible:
Evidence must be visible:
FlexiPage, Layout, or explicit user-provided fieldsFailure location must be visible:
Next actions must be visible:
Handle failures by using explicit fallback rules first, then recording object-level failure when no safe fallback remains. Do not convert unresolved failures into silent partial success.
Failure categories:
Default handling by failure category:
Layout; if required metadata still cannot be retrieved, fail the affected objectAllowed degradation paths:
Layout field resolutionDisallowed degradation paths:
Object-level and job-level rules:
When the export is for review, follow the Definition of Done output and validation requirements. Use the review package step to assemble the required field catalogs, object-level SOQL files, Excel files, and manifest into a business-readable handoff.
Use scripts in scripts/ for deterministic tasks instead of rewriting logic in the prompt.
Add references in references/ for:
polymorphic-owner-patterns.mdparent-traversal-patterns.mdreview-package-format.mdend-to-end-usage.mdpage-field-collection-sop.mdreferences/examples/Provide deterministic scripts in scripts/ for:
preflight_check.pycollect_metadata.pybuild_field_catalog.pyvalidate_export_results.pywrite_review_manifest.pyKeep SKILL.md focused on decision-making and workflow. Move object-specific mappings and reusable implementation details into scripts or references.