Skip to main content
Join Trailblazers for Dreamforce 2024 in San Francisco or on Salesforce+ from September 17-19. Register now

Test a Flow

Learning Objectives

After completing this unit, you’ll be able to:

  • Prepare to test a flow.
  • Test your flow to ensure it syncs handwritten leads in Gmail with leads in Salesforce and notifications in Slack as expected.

Prepare to Test a Flow

After you’ve designed your flow, you must test it from end to end to ensure it syncs data as expected.

As a best practice, test your flow using your test systems and data. After you complete testing, run the flow using your production systems and data. For Salesforce, this means using a sandbox org to test your flow and a production org to run your flow.

Also, as a best practice, test every possible path of your flow. For example, if your flow has an If branch and an Else branch in an If/Else block, ensure to test both branches.

In general, you have up to 10 minutes to complete a test. When the test completes or 10 minutes have passed, the test stops. As a best practice, you should get all required applications and data ready for the test before starting it.

In this use case, when an email with meetup in the subject and an attachment is sent to a Gmail account, it triggers the flow. First, be prepared to log in to an email account of your choice and then create and send an email with meetup in the subject and an attachment to the specified Gmail account.

Next, prepare to verify the following.

  • All extracted leads that don’t have a corresponding lead in the NTO org are created in Sales Cloud.
  • Messages containing relevant lead details appear in the sales-leads Slack channel.

Finally, if the leads exist in Sales Cloud, get ready to verify that no corresponding leads are created in Sales Cloud and no notifications appear in Slack.

Test a Flow

Follow these steps to test a flow.

  1. In the Sync Leads using MuleSoft RPA - Gmail to Salesforce to Slack flow, click Test. The flow goes into a read-only mode.
    Note: While the test is running, if you want to stop it, click Stop Test.
  2. Log in to an email account of your choice using your username and password.
  3. Compose an email with the following information.
    • To: Designated Gmail account that leads are sent
    • Subject: Automation meetup leads
  4. Attach a leads file to the email. In this example, we use the attachment shown in unit 1.
  5. Click Send.
  6. Go back to your flow and wait for the test to complete. If steps 3, 4, and 5 in the For Each block of the flow show a green check mark, this indicates the flow ran successfully.
    Tested flow showing step 1.Tested flow showing step 2.Tested flow showing For Each block and a green check mark on step 3 in For Each block.Tested flow showing rest of step 3 in For Each block.Tested flow showing If/Else block with If branch showing three conditions.Tested flow showing a green check mark on step 4 in If branch.Tested flow showing a green check mark on step 5 in If branch.
  7. Log in to the NTO org using your username and password.
  8. In the App Launcher, enter Sales, and then select Sales to launch Sales Cloud.
  9. Click the Leads tab, select All Open Leads, and verify six new leads are created in Sales Cloud.
    NTO org’s Sales Cloud leads showing six leads from the email attachment.
  10. Open a lead of your choice and verify its description is exactly as specified in your flow.
  11. Open your NTO Slack workspace and verify the lead notifications appear in the sales-leads channel. Notice that because you used *New lead:* in your flow, it appears as New lead: in Slack.
    Slack sales-leads channel showing a message with six leads from the email attachment.
  12. In the Sync Leads using MuleSoft RPA - Gmail to Salesforce to Slack flow, click Test again.
  13. Return to Gmail and repeat steps 3 through 5 of this procedure to compose another email with the same attachment.
  14. Go back to your flow and wait for the test to complete. If only step 3 in the For Each block of the flow shows a green check mark, this indicates the flow ran successfully. Because the leads exist in Sales Cloud, the If branch of the If/Else block evaluated to false and its two associated steps, steps 4 and 5, weren’t executed.
    Tested flow showing step 1.Tested flow showing step 2.Tested flow showing For Each block and a green check mark on step 3 in For Each block.Tested flow showing rest of step 3 in For Each block.Tested flow showing If/Else block with If branch showing three conditions.Tested flow showing step 4 in If branch without a green check mark.Tested flow showing step 5 in If branch without a green check mark.
  15. In the NTO org’s Sales Cloud, verify no new leads are created.
    NTO org’s Sales Cloud leads showing the same six leads from the previous email attachment.
  16. In your NTO Slack workspace, verify no new notifications appear in the sales-leads channel.
    Slack sales-leads channel showing the same message with six same leads from the previous email attachment.
  17. Repeat steps 1 through 16 to test another email with an attachment of your choice. Your flow should work as expected.
Note

In the preceding test, if you look closely at the leads in Salesforce and in Slack, you would notice that two handwritten items weren’t extracted correctly: Appy Bobeat instead of Appy Bobcat, and Ruth Elephant’s phone is lll-222-8888 instead of 111-222-8888. You would need to correct these leads in Sales Cloud and Slack. So, while the Marketing Leads Extractor RPA process eliminates time-consuming, highly error-prone tasks, human intervention is still needed sometimes to ensure extracted data is completely accurate. 

Good job! In the next unit, you learn how to activate, monitor, and troubleshoot your flow in the production environment.