It also supports related object (child) creation by extracting repeating structures (for example, invoice line-item tables) and generating one child record per row.

Below is a straightforward walkthrough of how the whole process works.

Create New Configuration

A Document Mapper configuration defines the target Salesforce object and the extraction/mapping rules CloudFiles uses to create a new record or update an existing record using values extracted from uploaded documents.

To create a new configuration, navigate to:

CloudFiles App → Document AI tab → Document Mapper subtab → Create New Configuration

Configure the basics

In the Create New Configuration screen, provide the following details:

  1. Configuration Name: Enter a clear name to identify this setup.
  2. Target Salesforce Object: Select the object where CloudFiles should create a new record or update an existing record (for example, Account, Opportunity, or a custom object such as Business_Document__c).
  3. Description (Optional): Add a short internal note describing the document type or scenario.

Click Save & Proceed to create the configuration.

Current Object Mappings

Current Object Mappings define how CloudFiles extracts values from the uploaded document and populates fields on the primary Salesforce record (the object you selected in the configuration).

Each mapping row represents one Salesforce field and contains:

  • the Target Field (where the value should be written in Salesforce), and
  • a Natural Language Prompt (what CloudFiles should extract from the document for that field).

Add a field mapping

  1. Click Add Field.
  2. In the new row:
    • Select the Salesforce Field you want to populate.
    • Enter the natural language prompt describing what value to extract from the document, and specify the expected output format (recommended).
  3. Repeat these steps for each field you want to populate on the main record.

How to write good prompts

Keep prompts short, explicit, and specific to the document. A good prompt typically includes:

  • what to extract (invoice number, date, total amount, etc.)
  • where to find it (header, summary section, billing block, etc.) when applicable
  • output format (strongly recommended)

Example prompts:

  • “Extract the document date from the header. Output format: YYYY-MM-DD.”
  • “Extract the invoice number. Output: text exactly as shown.”
  • “Extract the total payable amount. Output: number only (no currency symbol).”
  • “Extract the vendor name from the ‘Supplier’ section. Output: vendor legal name.”

Use Related Object Mappings only when you need to create child records from repeating data in a document—most commonly tables such as invoice or purchase order line items. This allows CloudFiles to extract multiple rows/entries and create one related record per row (for example, Line_Item__c, OpportunityLineItem, or a custom child object).

  1. Open the Related Object section.
  2. Select the Child Object you want to populate.
  3. Add a top-level prompt that identifies the repeating structure/table to extract. Example:
    • “Extract all line item rows from the invoice table.”

Add field mappings for the child object

After defining the top-level prompt, add field-level prompts for each child object field you want to populate. Examples:

  • “Extract the product name from each row. Output: text only.”
  • “Extract the quantity from each row. Output: whole number.”
  • “Extract the unit price from each row. Output: number only (no currency symbol).”
  • “Extract the line total from each row. Output: number only.”

Best practice: Specify output formats for each field to ensure consistent values across rows.

Use Salesforce Flows

In addition to standard extraction prompts, Document Mapper supports invoking Salesforce Flows directly within a field mapping.

To use a Flow:

  1. Select the Salesforce field to populate.
  2. Enter the Flow reference using the following syntax:

{!Flow_API_Name}

Example:

{!Get_contact_from_name}

After entering the Flow reference, Document Mapper displays the Flow's input variables under Flow Inputs.

For each input variable:

  1. Enter a prompt describing the value to extract from the document.
  2. Document Mapper extracts the value and passes it to the Flow during execution.

Example:

Flow InputPrompt
contact_nameExtract the first name of the license holder.

When the prompt runs:

  1. Document Mapper extracts the value from the document.
  2. The extracted value is passed to the Flow.
  3. The Flow processes the input and returns a result.
  4. The returned value is used to populate the selected Salesforce field.

Use Flow references when values require lookups, calculations, transformations, or other business logic before being mapped to Salesforce.

Running the Prompts

After configuring Current Object Mappings and (optionally) Related Object Mappings, validate your prompts using a test document.

Upload a test document

  1. Use the uploader on the right side of the screen to upload a sample PDF.

Run a single prompt

To validate one field mapping:

  1. Locate the field you want to test.
  2. Click Run Prompt next to that field.

Run all prompts

To validate the entire configuration:

  1. Click Run All Prompts at the top of the prompts list.

Review and refine

The extracted values will appear on the screen. Review the output for:

  • correctness of the extracted value, and
  • consistency with the expected output format (dates, numbers, identifiers, etc.)

If required, update prompts and rerun until results are consistent.

Enable User Access

After validating the configuration, enable users to launch Document Mapper from Salesforce by configuring one of the following entry points based on your workflow.

Finding Your Domain for Document Mapper URLs

Before setting up buttons, you need to find the correct domain for your Document Mapper URLs. We recommend using the following method to find your domain name -

  1. Go to Setup → Visualforce Pages
  2. Look for "documentMapperAction" in the table and open it
  3. Click on Preview
  4. This will open the Document Mapper in a new tab
  5. Copy the domain name from the URL in the address bar

The domain you copy will be in the format: https://<yourdomain>.vf.force.com

Option A: Setup List View Button To Create Record

To allow users to trigger Document Mapper directly from a Salesforce list view, create a custom List View Button on the object where the action should be available.

  1. In Salesforce, go to Setup → Object Manager
  2. Select the target object (for example, the Business Document object)
  3. Open Buttons, Links, and Actions and create a new button
  4. Configure it as a List Button
  5. Set Content Source to URL
  6. Choose to display it in the existing window (optionally without the sidebar or header, based on your org preference)
  7. Set the button URL using the following template by replacing <yourdomain> with your domain (obtained using the Visualforce Pages method above) and {your_config_id} with the Document Mapper configuration ID:

https://<yourdomain>.vf.force.com/apex/documentMapperAction?configId={your_config_id}

After saving the button, add it to the list view by editing the Search Layouts section for that object and moving the new button into the list of visible buttons. Once this setup is complete, users will be able to select records from a list view, click the new button, upload their document, and run the Document Mapper process seamlessly—without having to open or understand the backend configuration.

Option B: Setup Record Detail Page Button To Update Record

To allow users to launch Document Mapper from an individual record, create a Detail Page Button on the target object and add it to the page layout.

  1. Navigate to Buttons, Links, and Actions → New Button or Link on the required object.
  2. Set Display Type to Detail Page Button and Content Source to URL.
  3. Paste the Document Mapper URL in the button URL field using the format below (replace {your_config_id} with your configuration ID):
    https://<yourdomain>.vf.force.com/apex/documentMapperAction?configId={your_config_id}&recordId={!Object.Id}
  4. Click Save.
  5. Go to Page Layout, and add the button under Salesforce Lightning Experience Actions so it appears on the record detail page.

NoterecordId must be the current record’s Id. Use the object’s merge field in the button URL—e.g., {!Account.Id} for Account, {!Opportunity.Id} for Opportunity, or the corresponding {!ObjectApiName.Id} for custom objects.