Learn how to use App Connect to create an event-driven flow that copies a Wufoo file attachment from a submitted form and adds it as a Box file.

Note: This tutorial assumes that:

  • You have signed up for a free account for Box or you have a business account.
  • You have a paid Wufoo account. A paid plan is required for the File Upload capability that is used in this tutorial. (If you don’t have a paid account, you can still read this page to see how App Connect can help.)

Additional reference:
How to use IBM App Connect with Box
How to use IBM App Connect with Wufoo

Scenario:

You work in the Accounts department and receive expense reports via a Wufoo form that employees complete and attach their expense reports to. When a form is submitted, you want to copy the Wufoo attachment to Box so that you can collate and process the submitted expense reports on a monthly basis.

First, find or create everything you need:

  1. Obtain an App Connect subscription (Free or Personal).
  2. Obtain account details for connecting App Connect to your integrating applications:
    • (If you haven’t already connected App Connect to your Box account) The email address and password of your Box account
    • (If you haven’t already connected App Connect to your Wufoo account) The API key and subdomain of your Wufoo account

      To find your Wufoo API key, go to the Wufoo Form Manager, open the More drop-down menu for any of your forms, and click API information. (The same 16-digit API key is used for all your forms.) You can copy and paste this API key into App Connect.
      Finding your Wufoo API key

      To find your Wufoo subdomain, go to the Wufoo Account Manager. The subdomain value is included in the URL shown. You can copy and paste this value into App Connect.
      Finding your Wufoo subdomain

    If you haven’t already connected, complete these steps…

    1. Go to the Applications tab on the App Connect Catalog page to connect to your Box and Wufoo accounts.
    2. If Not connected is shown for Box or Wufoo, click to expand that row and then click the Connect button to enter the account information. For example:

      Connecting to Eventbrite

    3. If prompted, be sure to allow IBM App Connect to access the application’s account.

    Tip: You can also connect to an application when you add it to a flow.

  3. Create a Wufoo form to which expense reports can be attached:
    1. Log in to your Wufoo UI using the account that you configured in App Connect.
    2. Create a Wufoo form with the following settings:
      Form Name: Expense Report Submission
      Description: Fill me in to get your cash back.

      Click the Add Field button.
      From the Add a Field tab, click Section Break and configure these settings:
      Field Label: Expense report for:
      Instructions for User: Select the month and year.
      Add the following fields to the section with these field settings:
      Month (Field Type = Single Line Text)
      Year (Field Type = Single Line Text)
      (To save time, create these fields as text boxes rather than as drop-down lists that contain month/year values.)

      From the Add a Field tab, click Section Break and configure these settings:
      Field Label: Details:
      Instructions for User: Complete your details.
      Add the following fields to the section with these field settings:
      Click Name (to add fields for the first and last name).
      Click Email (to add an email field).
      Click File Upload (to add a Browse button) and change the Field Label value to Attach expense report.

      New Wufoo form sample for the Box tutorial

    3. Click Save Form and then go back to the Form Manager.
    4. Click Start sharing next to the form name.

      Share your Wufoo form (Box tutorial)

    5. From the Share page, make a note of the permanent link that references your form. (You will be required to enter this link later when you test the flow.) Remain logged in.

      Permanent link for the Wufoo form (Box tutorial)

      Tip: App Connect supports the use of embedded Wufoo forms. So you could, if preferred, copy the embed code from the Share page and use it to display the form within your own web page. For example, to embed within a WordPress website, all you’ll need to do is copy the code on the Embed on WordPress tab and then paste it into a WordPress doc. And then once you publish the doc, you can send users the link to the published doc that contains the embedded form.

  4. Create a text file that can be attached to the Wufoo form. Using a text editor, create a simple text file named expense_jdoe01.txt with the contents:

    Jane Doe: My Expense Report for Sept 2017
    1234

  5. In your Box instance, create a folder named ExpenseReports (with Editor permission) into which the Wufoo attachments should be copied.

    New folder named ExpenseReports in Box

Next, create your flow:

  1. Log in to App Connect Designer.
  2. From the Dashboard, click New > Event-driven flow.
  3. Complete the following steps. As you progress, App Connect automatically saves your changes. If you navigate away from the flow at any stage, the flow is saved as a draft flow that you can complete at another time.
    1. Enter a name that identifies the purpose of your flow; for example: Add expense reports to Box.

      Wufoo-to-Box flow name

    2. Select Wufoo > New form entry as the event that is to trigger the flow.

      Selecting the Wufoo 'New form entry' event

    3. Select the Wufoo form (Expense Report Submission) that you created earlier. This selection can be interpreted as “When someone fills in and submits the Expense Report Submission form, [perform the action that I’m about to add]“. (You will fill in this form later to test the flow.)

    4. Click the (+) and then select Box > Show More > File > Create file as the action that App Connect should use to add the Wufoo file attachment to Box.
    5. Specify the Box folder that you want to copy the Wufoo attachment to and then configure the remaining fields by mapping their values to those from Wufoo:
      • Folder: Select ExpenseReports from the list of folders in your Box instance.
      • File name: Click within the field, click Insert a reference Insert a reference icon, and then select Month from the list of available inputs. Click Insert a reference Insert a reference icon again and select Year. Type an underscore (_), and then click Insert a reference Insert a reference icon for the third time to select File Name. To help with collation in Box, you want the file names of all your submitted expense reports to be prefixed with the month and year for which expenses are being claimed in Wufoo.

        (Notice that the list of available inputs is auto-populated with the fields you added to your Expense Report Submission Wufoo form; for example, Month, Year, Email. A set of date and ID fields that are auto-generated in Wufoo are also included.)

      • File content: Type fi and then select File Content from the list (to indicate that the file contents of the Wufoo attachment should be copied to the Box file).
      • Type of file: Select Text from the list.

      Entries for the Create file action in Box

  4. From the banner, open the options menu [⋮] and click Start flow. Then click Dashboard to exit the flow. Your flow is displayed on your Dashboard as Running, and is listening for your event – a submitted form in Wufoo.

    Dashboard tile for the running flow

Finally, test your flow:

To test the flow, you can assume various roles: that of an Accounting team member, and an employee who wants to submit an expense report.

  1. [Employee]:
    1. From a new browser tab or window, paste in the permanent link of the Wufoo form that you created earlier.
    2. Complete the form as follows:
      • Month: September
      • Year: 2017
      • Name: Jane Doe
      • Email: jane_doe@example.com
      • Attach expense report: Click Browse and select the expense_jdoe01.txt file that you created earlier.
    3. Click Submit.

    Completed Wufoo form

  2. [Accounting team member]:
    1. Go back to the browser tab or window where you created the form.
    2. Go to the Form Manager and verify you can see that an entry has been submitted.

    Entry for completed Wufoo form

  3. [Accounting team member]:
    1. If necessary, log in to Box using the account that you configured in App Connect. If already logged in, simply refresh your browser. (You might have to wait a few minutes for the file transfer to complete.)
    2. Open the ExpenseReports folder and verify that you can see a file named September2017_expense_jdoe01.txt file.

    Wufoo attachment added to Box

Congratulations, you have created a flow that copies a Wufoo attachment in a submitted form to Box.


Growth icon for stretch exercises Stretch exercise – Try something a little different:
Rule separator for stretch exercises (bottom)

In the preceding exercise, you successfully created a flow that copies Wufoo attachments to a folder in your Box account. Now, imagine you want to ensure that the files (typically attached as expense.txt) are uniquely renamed in the Box folder, for each user submission per month. To help you do this, we’ll delve a little further into a couple of other features that App Connect provides: flow management and transform functions.

Run through these steps to update and retest the flow.

  1. Create a text file named expense.txt, which can be attached to the Wufoo form. (You can just make a copy of the previous file and rename it.)
  2. Now, stop the flow so you can edit it.
    1. From the Dashboard, locate the flow. A quick way for you to locate a flow is to enter the first few characters of the flow’s name in the search box (in this case, Add), or to sort your flows by name or date.

      Tools for locating or sorting flows

    2. Open the flow menu, and then click Stop. (Notice that there are other options that you can use to view the flow while it’s running, manage errors, export the flow for sharing, and delete the flow if no longer needed. For more information, see Managing flows.)

      Flow menu options

  3. To edit the flow, simply click anywhere on the tile.
  4. From the flow editor, click the Box node.

    We will now update the fields for the “Create file” action to specify a different naming convention for the file attachments.

  5. Update the File name field by applying transform functions to define a file naming convention of mmmyyyy_username_filename.txt.
    1. In the File name field, click Month and then select Apply a function from the context menu. Then select $substring() from the Functions list. The Month value is now shown as:
      {{$substring(Month, start, length)}}
    2. Click start and then type 0 (that is, zero). Click length and then type 3. This function lets us extract the first three characters in a month’s name.

      Updated Month value in the File name field

    3. Click after the underscore (_). Then click Insert a reference Insert a reference icon, and select Email from the list of available inputs. Then type another underscore.
    4. Click Email and then select Apply a function from the context menu. Then select $substringBefore() from the Functions list. The Email value is now shown as:
      {{$substringBefore(Email, "chars")}}
    5. Click chars and then type @. This function lets us extract the user name from an email address username@domain, by using the ampersand (@) as the delimiting character.

      The updated field should now look like this:

      Updated File name field

      And your completed entries for the “Create file” action should be similar to this:

      Updated Box fields

  6. To restart the flow, open the options menu [⋮] in the banner and click Start flow. Then click Dashboard to exit the flow. In the Dashboard, the flow is shown as Running again.
  7. From a new browser tab or window, paste in the permanent link of the Wufoo form that you created earlier, and then complete the form as follows:
    • Month: September
    • Year: 2017
    • Name: Huck Finn
    • Email: huckfinn@example.com
    • Attach expense report: Click Browse and select the expense.txt file that you created earlier.

      Click Submit.

  8. If necessary, log in to Box using the account that you configured in App Connect. If already logged in, simply refresh your browser. (You might have to wait a few minutes for the file transfer to complete.)
  9. Open the ExpenseReports folder and verify that you can see a file named Sep2017_huckfinn_expense.txt file.

    File in Box folder

Join The Discussion

Your email address will not be published. Required fields are marked *