Learn how easy it is to use App Connect to connect Wufoo to Salesforce and Asana so that every time someone submits a completed change of address form in Wufoo, a Salesforce contact is automatically updated or created, and, according to the Salesforce action, a task is added to the appropriate project in Asana.
For example, say that you’re running a couple of special promotions for new and existing customers who’ve just moved house. You want to make sure that you keep your systems up to date with your customers’ latest details, but you also want to strike while the iron’s hot and complete your promotion activities while they still have that “new home” feeling. You want to offer your existing customers a slightly different deal to reward their loyalty, so it’s important that you can identify them easily.
This tutorial shows how you can use conditional logic (in the shape of an “If” node) to take different actions depending on whether an existing Salesforce contact is updated, or a new one is created.
First, find or create everything you need:
- An App Connect subscription.
- The user names and passwords for your Asana and Salesforce Developer Edition accounts (if you haven’t already connected App Connect to your accounts). You can connect to your accounts now on the Applications tab on the Catalog page, or you can connect as you add each application to your flow.
- The API key and subdomain for your Wufoo account.
- To find your Wufoo API key, go to the Wufoo Form Manager, click More next to any form, then select API information. Copy the 16-digit API key and paste it into App Connect.
- To find the subdomain for your Wufoo account, go to the Wufoo Account Manager by clicking Account, then selecting My Account. Copy the name between // and .wufoo.com and paste it into App Connect; so if your account has http://subdomainname.wufoo.com, just copy subdomainname to App Connect.
- A test change of address form in Wufoo that you’ve shared. Make sure that the form has fields for the customer’s name, address, and email address. (We added the “Fancy Pants” Name, Address, and Email fields.) You’ll use these fields to update or create a contact in Salesforce.
- At least one test contact in Salesforce Developer Edition (with a mailing address and an email address) that you can update during this tutorial.
- Two projects in Asana: one called “New home promotion – existing customers”, and one called “New home promotion – new customers”.
- If you want a bit more information before you start, you can read more about how to use App Connect with these apps on the following pages:
Next, create your flow:
(App Connect automatically saves your changes as you go. If you move away from the flow at any point, the flow is saved as a draft flow that you can come back to later.)
- Log in to App Connect.
- From the Dashboard, click New > Event-driven flow.
- Enter a name that identifies the purpose of your flow, for example:
Change of address promotion.
- Select Wufoo as your first application (source), then select New form entry as the Wufoo event that’ll trigger the actions in Salesforce and Asana. “New form entry” means that one of your forms has been completed and submitted.
(If you haven’t already connected to your Wufoo account, click Connect and follow the instructions to allow App Connect to access your Wufoo account.)
- Select your change of address form.
- If the list of target applications isn’t shown automatically, click the plus (+) and select Salesforce as your second application (target). Expand Contact, then select Update or create contact as the Salesforce action. This action will update the contact if it exists, or create it if it doesn’t. This action is sometimes called an upsert.
(If you haven’t already connected to your Salesforce account, click Connect to connect now.)
- As email addresses are unique, you can use the email address to identify your contact. So you’ll create a filter to update the Salesforce contact whose email address is the same as the submitter of the Wufoo form. The filter is the field called Update where all of the following conditions are true.
- For each piece of data that you store in Salesforce for your contact, click the Insert a reference icon , then select the appropriate Wufoo field that contains the data that you want to transfer to Salesforce, as shown in the following example:
- For our final action, we want to update Asana. But we want to take different actions depending on whether an existing contact has been updated in Salesforce, or a new contact has been added. We need to define some conditional logic to make that decision, so add an If (conditional) node to your flow. Click the plus (+), open the Toolbox tab, then select If (conditional).
- In the If node dialog box, configure the “if” branch.
- In the first field of the “if” statement, expand Salesforce/Update or create contact response, and select Status code.
- Ensure that the operation field says equals.
- If an existing record is updated, a response code of “200” is returned; if a new record is created, the response code is “201”. So set the third field of the “if” branch to “200” so that the full condition reads Status code equals 200.
- In the If node dialog box, click Add else if, and set that “if” condition in the same way, but this time to say Status code equals 201.
- Configure the else section of the If node dialog box.
- Select Exit flow at the end of this branch.
- Set the message type to Bad Request (400).
- For the message, type something like “No record was updated or created in Salesforce”. You’ll see this message on your flow tile on the Dashboard if it occurs.
- We’ll now add some actions to the If node in our flow. Click the plus (+) on the “if” branch of the If node that says “Status code equals 200”, and select the Asana “Create task” action.
(If you haven’t already connected to your Asana account, click Connect to Asana to connect now.)
- Select the Asana project called “New home promotion – existing customers” (because a response code of “200” means that an existing customer record was updated).
- In the Task name field, type “Send existing customer new home promotion campaign to”, add a space, then click Insert a reference and select the Wufoo Email field.
- Repeat the last 3 steps to add another Asana “Create task” action to the “if” branch that says “Status code equals 201”. But this time, select the “New home promotion – new customers” project, set the Task name to “Send new customer new home promotion campaign to”, add a space, then map to the Wufoo Email field.
- From the banner, open the options menu [⋮] and click Start flow. Then click Dashboard to exit the flow. You can now see the flow on your Dashboard; as long as it says “Running”, it’s listening for your event – someone submitting a change of address form in Wufoo.
Finally, test your flow:
- Fill in your change of address form in Wufoo and submit it. Try submitting one form that uses the email address of a contact that’s already set up in Salesforce, and submit another form for a brand new contact.
- Log in to your Salesforce Developer Edition account and look at your list of contacts. You should see that your existing contact has been updated, and a new one has been created, showing the contact details that you sent in your Wufoo form.
- Log in to your Asana account and look at your projects. You should see a task in each project, prompting you to send the appropriate campaign to your new and existing customers.
You’ve created a flow that automatically updates Salesforce and Asana every time a new change of address form is received in Wufoo.
If you can’t find what you want, or have comments about this tutorial, please either add comments to the bottom of this page or send us your comments by email.