Audience: build-along attendees (customer-facing). Everything in this guide is fictional: Copperline Equipment Finance, its customers and its documents were made up for the AppExchange Amplified build-along.

This guide takes you from a prepared org to the finished Copperline automation, one step at a time, in the order the steps have to happen. Use it if you fell behind during the live session or want to build it again on your own. It uses Google Drive as your storage, because that is what the prerequisites page sets up.

What you will build

Copperline lends small businesses the money for equipment. Every deal arrives with the same pile of documents, and today somebody retypes the supplier invoice and then types it again into the finance agreement. When you finish, your org will do this:

  1. A folder per customer and a folder per deal, created the moment the record is saved, with the same five subfolders in every deal: Application, Supplier Invoice, Identity, Agreement, Others.
  2. The folders on the records. The Account shows the customer's folder, the Opportunity shows the deal's folder, and nothing is kept in Salesforce file storage.
  3. Documents that sort themselves. Drop every document into the deal folder; Document AI decides what each one is and moves it into the right subfolder.
  4. No retyping the invoice. A Document Mapper reads the supplier invoice and writes its ten details onto the Opportunity.
  5. The finance agreement in one click, built from the Account and the invoice details and saved in the deal's Agreement folder, and only once the invoice is in.

You will build five flows, one Document Mapper, one document template and one button.

Flow Runs when Does
1. Customer folder an Account is created creates the customer's folder and attaches it to the Account
2. Deal folder an Opportunity is created creates the deal folder and its five subfolders, attaches it, saves every folder id
3. Send to Document AI a file is uploaded to a deal folder sends the file to Document AI and records it as a Related Document
4. File and read Document AI has finished reading a file decides what the file is, moves it, and runs the mapper on an invoice
5. Generate the agreement someone clicks the button builds the agreement PDF in the Agreement folder

What you need first

Do not create the sample Accounts and Opportunities from the Build page's "Copperline's sample records" section yet. Folders are created when a record is created, so a record made before Flows 1 and 2 are active never gets a folder. If you already made them, delete them; you create them again in Step 11.

How the flows in this guide are built

Read this once; every flow relies on it.