Document AI
Configuration
Document Mapper Setup
document mapper is a configuration driven extraction and mapping layer that converts uploaded documents (pdfs such as invoices, pos, agreements, onboarding forms) into salesforce record operations using a set of field level prompts defined in a document mapper configuration, cloudfiles runs ai based extraction against the document, normalizes the output into expected formats, and maps the extracted values into salesforce fields to create new records or update existing records 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 1\ 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 configuration name enter a clear name to identify this setup 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) description (optional) add a short internal note describing the document type or scenario click save & proceed to create the configuration 2\ 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 click add field 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) 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 ” 3\ related object mappings 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) configure a related object mapping open the related object section select the child object you want to populate 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 4\ running the prompts after configuring current object mappings and (optionally) related object mappings , validate your prompts using a test document upload a test document use the uploader on the right side of the screen to upload a sample pdf run a single prompt to validate one field mapping locate the field you want to test click run prompt next to that field run all prompts to validate the entire configuration 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 5\ 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 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 in salesforce, go to setup → object manager , select the target object (for example, the business document object), then open buttons, links, and actions and create a new button configure it as a list button , set content source to url , and choose to display it in the existing window (optionally without the sidebar or header, based on your org preference) after creating the button, set its url using the following template by replacing \<yourdomain> with your salesforce domain and {your config id} with the document mapper configuration id https //\<yourdomain> vf force com/apex/documentmapperaction?configid={your config id} to find the \<yourdomain> value for the document mapper url, copy it from your salesforce org url for example, if your salesforce address is https //cloudfiles testdrive dev ed develop lightning force com/ , then is the part before lightning force com , which is cloudfiles testdrive dev ed develop you would then construct the document mapper link in visualforce format as https //cloudfiles testdrive dev ed develop 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 navigate to buttons, links, and actions → new button or link on the required object set display type to detail page button and content source to url 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} click save go to page layout , and add the button under salesforce lightning experience actions so it appears on the record detail page note recordid 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