Tutorials
Document AI Tutorials
Create Custom Object & Child Records Instantly — Just Prompts with Document Mapper
overview in this tutorial, you’ll learn how to use cloudfiles document mapper , a powerful no code feature that integrates seamlessly with salesforce list view buttons to automate the processing of business documents—such as purchase orders, invoices, quotes, and other structured files document mapper analyzes the uploaded document, extracts key information, and automatically creates the corresponding salesforce records, including any related child records like line items, based on the configuration you define this enables you to convert structured documents into clean, accurate salesforce data with minimal setup and no manual data entry with this setup, cloudfiles will automatically detect the document type (po, invoice, quote, etc ) extract important fields such as document number, document date, total amount, company name, and document description identify and parse line items (if present) and create corresponding child line item records associated with the parent business document before configuring this automation, ensure that the required prerequisites are completed once ready, you can begin building your query automations and update rules to fit your specific use case refer to the sections below for detailed guidance the image below provides a visual overview of how the document mapper process works pre requisites before starting with this tutorial, you need to ensure that cloudfiles document ai is properly installed & configured in your system additionally, you also need to create some initial automations to process the files before you can query them check the 2 sections below carefully installation & configuration ensure the following before starting cloudfiles document ai docid\ rfxciqrbejmpsmbczexam and docid\ amnhmxwixyngnaxerbkwd are complete you have an active subscription or trial of cloudfiles document ai the cloudfiles event mode setting is set to custom object create a document mapper configuration navigate to cloudfiles app → document ai → document mapper , then click create new configuration t o start setting up your document mapping start by selecting the salesforce object you want to map documents to, such as an account, opportunity, or any custom object once the object is selected and saved, you can define the fields and provide ai prompts that instruct cloudfiles on what information should be extracted from the uploaded documents when configuring the data extraction, click the +add button to open the configuration popup shown in the image below from here, you can also add a related object , allowing you to define child object mappings for scenarios where the document contains line items or similar structured sub records specify the child object type, outline the fields that need to be extracted, and define prompts that help identify both the line item section and each of its individual fields after setting up the extraction rules, upload a sample document to fine tune the prompt and achieve the expected output this helps ensure the ai correctly understands your instructions before deploying the configuration once you are satisfied with the results, simply click save to generate the config id , which you will later use when integrating document mapper with list view or detail page buttons in salesforce you’ll use this config id while setting up your list view or detail page buttons create a new list view button to allow users to trigger document mapper directly from a salesforce list view, begin by creating a new list view button on the business document object go to setup → object manager , open the business document object, and navigate to buttons, links, and actions to create a new button or link configure it as a list button , set the content source to url , and choose the behavior to display in the existing window without the sidebar or header next, copy the template url below, replace \<yourdomain> with your salesforce domain, and substitute {your config id} with the config id generated in the previous step template url https //\<yourdomain> vf force com/apex/documentmapperaction?configid={your config id} after saving the button, add it to your list view layout test it in action once configured, users can simply click the button, upload a file, and let document mapper automatically create the corresponding records before saving, a preview screen will display the newly created record, allowing users to review and adjust the extracted field values if needed after verifying the information, they can click save records to finalize the record creation after completing all the steps, you can view the newly created record by navigating to the business document object’s list view by opening the newly created business document record, you can also see the automatically created child line item records in the related list