Loading
Salesforce now sends email only from verified domains. Read More
Automate Your Business Processes
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Use an Online Form to Create a Record Example

          Use an Online Form to Create a Record Example

          Create a screen flow that collects information about a new opportunity and then automatically creates an opportunity record. For example, on customer calls, your reps scramble to capture notes about customer interest in new products. They often use sticky notes, which are hard to read or get lost. Create an online form embedded on the case record page so they can quickly capture and confirm basic information. When they submit the form, the screen flow creates a new opportunity on the Account record that’s related to the case.

          Required Editions

          View supported editions.
          User Permissions Needed
          To open, edit, create, activate or deactivate a flow using all flow types, elements, and features available in Flow Builder, including Einstein and Agentforce for Flow: Manage Flow

          View this video in a separate tab.

          Create the Flow

          Create the online form that collects the information using a screen element, and configure the flow to create an opportunity.

          1. Open the Flows list view.
            • From Setup, in the Quick Find box, enter Flows, and then select Flows.
            • From the Automation app, select the Flows tab.
            • From the Flows tab in any Lightning app, click the actions menu and select Open Flow.
          2. Create a screen flow.
            • From the Automation app, click New | Screen Automations | Screen Flow.
            • From Setup, click New Flow | Screen Automations | Screen Flow
            The new screen flow opens in Flow Builder.
          3. Create the resource that holds the case record the rep is working on.
            Capture the case so the flow can find the account that's related to the case and the new opportunity. After you add the flow to the Case record page in Lightning App Builder, the record page can send the open case record to the flow so the flow can find the right case.
            1. Open the Toolbox by clicking Toolbox icon.
            2. Click New Resource.
            3. For Resource Type, click Variable.
            4. For API Name, enter recordId.
            5. For Data Type, select Record.
            6. For Object, select Case.
            7. For Availability Outside the Flow, select Available for input.
              Since the variable is available for input, the record page can send the case to the flow and the flow can store the record.
            8. Save your work.
            New Resource window showing the configured settings.
          4. Create the resource that holds the close date for the new opportunity.
            1. Open the Toolbox by clicking Toolbox icon.
            2. Click New Resource.
            3. For Resource Type, click Formula.
            4. For API Name, enter CloseDate.
            5. For Data Type, select Date.
            6. For Formula, enter TODAY()+30.
            7. Save your work.
            Edit Formula window showing the configured settings.
          5. Add and configure a screen element.
            This step collects information from the user that's used to create the opportunity.
            1. Click Plus icon used to add an element or action., and select Screen.
            2. For Label, enter Collect Opportunity Details and use the default API name: Collect_Opportunity_Details.
            3. In the Components list, click Text to add a text component to the screen. For Label, enter Product. Use the default API name.
            4. In the Components list, click Long Text Area to add a long text area component to the screen. For Label, enter Comments. Use the default API name.
            5. Click Done.
            Edit Screen window showing text and long text area screen components.
          6. Add and configure Create Records element after the Collect Opportunity Details screen.
            This step creates the opportunity using field values we specify.
            1. Click Plus icon used to add an element or action., and select Create Records.
            2. For Label, enter Create Opportunity and use the default API name: Create_Opportunity.
            3. For How to set record field values, select Manually.
              Select Manually so you can set the new record's field values one by one.
            4. For Object, search for and select Opportunity.
              Select Opportunity so the flow creates an opportunity record. Next, you'll add the values for the new record. Every org is different. When setting field values, include all of that record's required fields. For this example, Close Date, Name, and Stage are required fields and are automatically added to the list of fields to add.
            5. For Close Date, select the CloseDate formula resource you created.
              This sets the value of the close date to 30 days after the day the opportunity is created.
            6. For Name, select the Collect Opportunity Details screen and then select the Product screen component.
              This associates the opportunity name's value to the product the rep enters in the screen flow.
            7. For Stage, select Prospecting, which is the first stage in this example's opportunity process.
            8. Click Add Field.
            9. For Field, select Description and for Value, select the Collect Opportunity Details screen and then the Comments screen component.
              This sets the value of the opportunity's description to the comments that the rep enters into the screen flow.
            Create Records window showing field value selections.
          7. Add and configure another Screen element.
            This step lets the rep know that the record was created successfully.
            1. Click Plus icon used to add an element or action., and select Screen.
            2. For Label, enter Display Confirmation and use the default API name: Display_Confirmation.
            3. In the Components list, click Display Text. For API Name, enter ConfirmationMessage.
            4. In the text box, in the Insert a resource field, select the Product screen component.
              A merge field with the name of the opportunity is added to the text box.
            5. After the merge field, enter opportunity was created.
            6. Click Done.
            7. Save your work.
            Edit Screen window showing the Display Text screen component.
          8. Save the flow and give it a label and an API name.
            For this example, the label is Flow Example: Online Form that Creates an Opportunity.
          9. To test your flow, click Run and enter sample information.
          10. To activate your flow, click Activate.
            Screen flow showing the three elements with their labels.

          Add the Flow to the Case Record Page

          Add the screen flow to the case record page.

          1. Open Lightning App Builder and edit the case record page.
            1. From Setup, in the Quick Find box, enter Lightning App Builder, and then select it.
              Lightning App Builder opens.
            2. For the Case Record Page, click Edit.
              The Components Panel opens listing all of the standard and custom components available for the Case Record Page.
          2. Add a flow component to the page.
            1. From the list of components, drag the Flow component onto the page.
              The flow component configuration panel opens.
            2. For Flow, click the name of the active screen flow to add to the page. For this example, select Flow Example: Online Form that Creates an Opportunity.
              The recordId variable resource you created in the flow shows in the panel and is ready for a value to pass to the flow.
            3. Select Pass all field values from the record into this flow variable.
              The value for recordId populates with the case that the rep has open on the page.
              Flow component configuration panel open showing the configuration selections.
            4. Save your work.

              The flow is on the case record page and is ready to create opportunities.

              The open case record showing the screen flow form with the Product and Comments fields available.
           
          Loading
          Salesforce Help | Article