The Scenario
You are three weeks into onboarding 15 new enterprise accounts. Each account needs to exist in Salesforce with 3 to 5 initial support cases already attached. You have the structure in an Excel workbook: account names in column A, case subjects in columns B through F, one row per account.
Row-by-row API calls are not an option. With 15 accounts and up to 5 cases each, you are looking at 90 separate API requests — and Salesforce's API rate limits will make that painful before you reach account 8.
The bad version:
- Create the first Account via the API, note the returned AccountId.
- Create Case 1 linked to that AccountId, create Case 2, create Case 3.
- Move to account 2, repeat.
- Hit a rate limit partway through, wait, resume, lose track of which accounts were completed before the error.
The composite sObject tree endpoint exists for this exact scenario. But building the nested payload manually is the kind of work that turns a 20-minute task into an afternoon.
The Easy Way: One Prompt in SheetXAI
SheetXAI is an AI agent inside your Excel workbook. It reads the hierarchical structure from your rows and uses the Salesforce composite sObject tree endpoint to create parent Accounts with nested child Cases in a single API call per account.
From my Excel sheet, build Salesforce sObject trees where each row group is a parent Account with nested Cases; insert all trees using the composite tree endpoint and write the generated IDs back
What You Get
- One composite sObject tree API call per account row, with the Account as parent and each non-blank case subject in columns B through F as a nested child Case.
- The generated Salesforce AccountId written back into the workbook for each successful account.
- Child Case IDs written into adjacent columns so you have a complete record of what was created.
- Rows that fail get error notes written back instead of silently dropping.
What If the Data Is Not Quite Ready
Some accounts already exist in Salesforce — only the cases need creating
Column G has existing AccountIds for some rows.
For rows where column G has a Salesforce AccountId, skip account creation and use that ID as the parent — create only the child Cases from columns B through F and write the Case IDs into adjacent columns
Case subjects in columns B through F also have descriptions on a second worksheet
Case creation needs both Subject and Description, which live across two worksheets.
Join the account rows on this worksheet with the case description rows on the Cases worksheet using column A as the key, then build Salesforce composite sObject trees with each Account and its child Cases using matched Subject and Description fields — write the generated IDs back
Some case columns are blank — only non-blank ones should become cases
Row 3 has entries in columns B, C, and D but columns E and F are empty.
For each row in this workbook, create a Salesforce composite sObject tree with the Account from column A and child Cases only for non-blank values in columns B through F — skip blank cells rather than creating empty-subject cases
Full tree creation with validation, blank filtering, and existing-account detection
Check whether the account already exists, skip creation if it does, filter blank case subjects, and write all generated IDs back.
For each row: check whether an Account with the name in column A already exists in Salesforce — if it does, use that AccountId; if not, create the account via composite tree insert with non-blank child Cases from columns B through F. Write AccountId into column G and Case IDs into columns H through L.
One prompt handles the full hierarchical onboarding in a single pass.
Try It
Get the 7-day free trial of SheetXAI and open your account onboarding workbook, then ask SheetXAI to run the composite tree inserts. For related reading, see the hub overview or the spoke on composite batch requests for handling bulk updates after records are created.
