Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. 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 updated inventory items in NetSuite with products and associated price book entries in Salesforce 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 flows using your test systems and data. After you’re done with testing, run the flows using your production systems and data. For Salesforce, this means using a sandbox org to test your flows and a production org to run your flows.

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 inventory item is updated in NetSuite, it triggers the flow. First, be prepared to update an inventory item in NetSuite. 

Next, if a corresponding product doesn’t exist in Sales Cloud, prepare to verify the following.

  • A product containing relevant inventory item details, including the inventory item’s internal ID, is created in Sales Cloud.
  • The inventory item is updated with its associated product ID in NetSuite.
  • A price book entry associated with the product is created in Sales Cloud.

Finally, if a corresponding product exists in Sales Cloud, prepare to verify the following.

  • The product is updated with relevant inventory item details in Sales Cloud.
  • The price book entry associated with the product is updated in Sales Cloud.

Test a Flow

Follow these steps to test a flow.

  1. In the Sync NetSuite Inventory Items to Salesforce Products and Price Book Entries flow, click Test. The flow goes into a read-only mode.
    Note: While the test is running, if for some reason you want to stop it, click Stop Test.
  2. Log in to NetSuite using your username and password.
  3. In the Search field, enter Mobile Station Desk and select the DES00002 Mobile Station Desk Steel/Wood - Beach inventory item that appears.
    Note: If you don’t have this item in your NetSuite instance, use any existing inventory item of your choice.
  4. Click Edit.
  5. Update the following values of this inventory item. Notice by default the item’s internal ID is 127, and its Salesforce product ID is blank.
    • Display name: Mobile Station Desk Steel/Wood - Sandy Beach
    • Purchase price: 99.99
    • Purchase description: Mobile Station Desk Steel/Wood - Sandy Beach
      NetSuite Inventory Item page with display name, purchase price, and purchase description.
  6. Click Save to create the inventory item.
  7. Go back to your flow and wait for the test to complete. If steps 1 through 5 of the flow show a green check mark, this indicates the flow ran successfully. The List of Product condition in the If branch of the If/Else block evaluates to true. This indicates the updated inventory item doesn’t have a corresponding product in Sales Cloud, so the steps in the Else branch of the flow weren’t executed. Take a look at the Test Output section and see the record values you entered for the test.
    Tested flow showing a green check mark on step 1.Tested flow showing a green check mark on step 2.Tested flow showing If branch with condition if list of products is empty.Tested flow showing a green check mark on step 3 in If branch.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.Tested flow showing Else branch and no green check mark on step 6 in Else branch.Tested flow showing no green check mark on step 7 in Else branch.
  8. Tested flow showing For Each block of Else branch and no green check mark on step 8 in For Each block.Log in to your NTO org using your username and password.
  9. From the App Launcher, enter Products and select Products.
  10. View all products. Verify the Mobile Station Desk Steel/Wood - Sandy Beach product matching the updated NetSuite inventory item has been created.
    Sales Cloud products showing product matching NetSuite inventory item.
  11. Click Mobile Station Desk Steel/Wood - Sandy Beach. Verify the product also has a NetSuite item ID. In this example, it’s 127, which is the internal ID of the NetSuite inventory item.
    Product showing NetSuite item ID.
  12. Click Related, click the down arrow associated with the Standard Price Book, and then click View. Verify a price book entry shows the list price $99.99 for the product in the Standard Price Book.
    Price Book Entry showing list price.
  13. Access your inventory item in NetSuite and verify the inventory item has been updated with a Salesforce product ID. In this example, it’s 01t1U000006dXOVQA2, which is the ID of the Sales Cloud product.
    Inventory item showing Salesforce product ID.
  14. In the Sync NetSuite Inventory Items to Salesforce Products and Price Book Entries flow, click Test again.
  15. In NetSuite, update the following values of the inventory item.
    • Display name: Mobile Station Desk Steel/Wood - Pebble Beach
    • Purchase price: 189.99
    • Purchase description: Mobile Station Desk Steel/Wood - Pebble Beach
  16. Click Save to create the inventory item.
  17. Go back to your flow and wait for the test to complete. If steps 1, 2, 6, 7, and 8 of the flow show a green check mark, this indicates the flow ran successfully. The List of Product condition in the If branch of the If/Else block evaluates to false. This indicates the updated inventory item has a corresponding product in Sales Cloud, so steps 3 through 5 in the If branch of the flow weren’t executed.
    Tested flow showing a green check mark on step 1.Tested flow showing a green check mark on step 2.Tested flow showing If branch with condition list of products is empty.Tested flow showing no green check mark on step 3 in If branch.Tested flow showing no green check mark on step 4 in If branch.Tested flow showing no green check mark on step 5 in If branch.Tested flow showing Else branch and a green check mark on step 6 in Else branch.Tested flow showing a green check mark on step 7 in Else branch.Tested flow showing For Each block in Else branch and a green check mark on step 8 in For Each block.
  18. In the NTO org’s Sales Cloud, verify the existing product matching the updated NetSuite inventory item has been updated. Notice its product name is Mobile Station Desk Steel/Wood - Pebble Beach.
    Product showing updated product name.
  19. Click Mobile Station Desk Steel/Wood - Pebble Beach.
  20. Click Related, click the down arrow associated with the Standard Price Book, and then click View. Verify the price book entry shows the list price $189.99 for the product in the Standard Price Book.
    Price Book Entry with updated list price.
  21. Repeat steps 1 through 20 to test another inventory item of your choice. Your flow should work as expected.

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

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback