Tutorial: Passing data from Salesforce to a flow

Content under development

In order to pass data to a flow, you need to do a couple of things – Set up your flow to receive the information, and set up the Visualforce page to send the information. Data that can be passed into a flow as values include objects and lists, but we will focus on a string value for now. (The same procedure will work for all values, except objects and lists).

Here’s how we can set up the flow:

  1. Click LOG IN to login to the Boomi Flow Drawing Tool.
  2. Click Values in the sidebar to open the Values tab.
  3. Click New Value.
  4. In the Name field, enter a name for the value. Example: My Input. (If you are using a different name, make sure to use that name instead in the procedures that use ‘My Input’ in Salesforce.)
  5. Select String from the What kind of Value is this? drop-down menu.
  6. Click the + icon to expand the Advanced section.
  7. Select Input from the Access menu and click Save Value.
  8. Click Flows and click New Flow to create a new flow.
  9. From the dropdown menu Which Service should be used for authentication select ManyWho Identity Service and click Continue.
  10. Enter a name for the flow in the Name field. Example: PassingData.
  11. Select Anyone can run this flow in the Access menu.
  12. Select None from the Social feed for collaboration menu.
  13. Click Start Building.
  14. Click Shared Elements on the right-hand-side navigation.

    This opens the Shared Elements panel with the Values tab showing.
  15. Click Import Existing.
  16. Click the Import button next to the value you created (Step 3 to Step 6, above).

    This imports the value into your flow.
  17. Click Close.
  18. Drag a Step element from the sidebar, to the canvas. This opens a Configuration Panel for the Step.
  19. In the Name field enter a name for the Step. Example: My Step.
  20. Click Insert Value.

    This opens the Insert a Value dialog box.
  21. Select the value you created, and click Ok.

    This inserts a reference to the value in the content editor.
  22. Click Save Step. This is what the canvas looks like now:
  23. Hover your mouse on Start. The mouse pointer changes from a crossbar to a hand.
  24. Drag an arrow from Start to Welcome. This opens a Configuration Panel on the right-hand side.
  25. In the Configuration Panel, type Go in the Name text field, and click Save Outcome.
  26. Click the Publish icon on the right-hand-side menu.

    This opens the Publish Flow dialog box.
  27. Click Publish.
  28. Close the Publish Flow dialog box.

Here’s how we can set up the Visualforce page:

  1. Login to Salesforce and click Setup.
  2. Create a clone of the ManyWho Visualforce page. (Enter ManyWhoWhoFlowData in the Name field. The Label field says flowdata.)
  3. We will now edit the cloned page. Click Edit.
  4. Find the var inputValues = null; line in the code (Ln 100 in the picture).

    Note: As you see, we use a standard convention for populating input values for SalesforceNotificationRecordId and SalesforceNotificationObjectName.
    SalesforceNotificationRecordId:

    SalesforceNotificationObjectName:

    Both SalesforceNotificationRecordId and SalesforceNotificationObjectName are string values you can add to the flow. You can populate them by putting the object-id and object-name parameters in your URL. For example, the code for Contact will be:

    We will follow the same convention while passing information to our My Input value.
  5. Find the var options = { line in the code (Ln 124 in the picture).
  6. Enter this block of code above the var options code block.

    This block of code does the following:

    • It tells the engine we want to assign a value with the developer name of “My Input”. (This is the name of the value you created earlier when you were building the flow. If you used a different name, assign that name instead.)
    • It indicates that the value being passed in is a String (or ContentString). Values can also be ContentNumber, ContentDateTime, ContentPassword, etc. This should also match the kind of the value you created, but it is not a requirement.
    • It assigns the content value to a parameter in the querystring called ‘input’.
  7. Click Save to save the page.

Appchievement!
  1. The URL in your address bar is something like this https://na30.salesforce.com/home/home.jsp.

    Edit the URL to https://na30.salesforce.com/apex/flowdata?flow–id={insert your Flow ID}&input=HelloWorld
    The URL will look like this: https://c.na30.visual.force.com/apex/flowdata?flow-id=77296ee5-ec91-4b3b-8b62-43528cc13ad3&input=HelloWorld


Check out the glossary for a definition of terms and key concepts that appear in the Boomi Flow website, Drawing Tool, technical documentation, blogs, and marketing communications.

If you need to take a closer look, click on the images to enlarge them. Have a question? Click the Help button on the bottom right-hand corner of this page to ask.