Web-to-Anything: Secure Forms with FormAssembly

Hello!

FormAssembly (FA) is an easy to use, powerful web form platform.

In this example we will use it to build a secure form. It will do the following:

  • send a form to the email address realated to a Contact record in Salesforce
  • make sure users verify their email address to access the form
  • record the response back in Salesforce

There are a few steps we need to perform:

  1. Create an FA Integration User in Salesforce
  2. Get an FA account
  3. Build FA forms
  4. Build an FA workflow
  5. Add a Salesforce Quick Action to trigger the workflow
  6. Test the solution :>

1. Create an FA Integration User in Salesforce

This one should be pretty straightforward, if you have any experience with Salesforce.
In Salesforce, create a user with sufficient permissions to update the objects you are planning to work with.
Save the user’s credentials.

2. Get an FormAssembly account

Go to https://www.formassembly.com/ and buy a license or get your trial account.
Once you get your FA credentials, you are ready to go!

3. Build forms

It is time to play around with the FormAssembly itself.
For the sake of this example, we will build 3 forms:

  • Request Verification Code
  • Verify Email Form
  • QA form

Request Verification Code Form

Once you login to your account click the +New Form button in the navigation bar.
Let’s go with the Blank Form option.

Choose Form

You will be presented with the form builder. Play around with it! You can give your form a title, select a predefined theme or even build one on your own. Let’s add a few fields to the form:

  • VerCode
  • Email – make sure you set field type to Email
  • ContactId
  • First Name
  • Last Name

Request Code Full

Mark all the fields as hidden so the end user cannot see them:

Request Code Initial

Adjust labels, layout, colors, or any final changes you want to do before saving the form.
You can preview the form to check what it will look like for the user using the Preview button:

Request Code Preview

Let’s now connect to Salesforce.
Go to Connectors on the left bar. Under Form Opened click Add connector and choose Salesforce (Prefill). Your connectors page should look like this:

Request Code Connector

Click Configure on the connector to set up connection with Salesforce.
Use credentials created in Step 1. to add a connection.
Make sure the connector is enabled.
Click on the Configure your first lookup button, select Contact as Salesforce object.
From fields list choose Contact Id, then go with Equals and an unsafe query parameter.
For the fields mapping choose the following:

Connector full

The VerCode formula will generate random 6 digits number, used as a Verification Code. You can adjust it as you please.
Save your changes.

Verify Email Address Form

It is time to build the second form.
Create new form and add one input field. The label should ask user to enter the code. Style it as you wish. Your final form should look similar to the following:

Verify Email

There is no need to add any connectors here.

QA Form

It is time to build the last form. It will contain 3 sections.

  • Overview section with prepopulated FirstName and LastName
  • General Information with a few questions the end user can answer
  • ContactId – hidden field

Feel free to play around with the fields format, validations etc. to discover all possibilities FA provides.

QA Form

Let’s move to the connector part.
Add Salesforce (Prefill) connector on Form Opened. Configure it so it looks like the following:

Connector QA Form

4. Build workflow

We are now ready to build our workflow and trigger it from Salesforce.
Go to the FA Home Page and click the New Workflow button. You will be presented with the workflow builder:

Workflow Initial

  1. Let’s start with selecting the first form – Verify Email Address.

  2. Add next step using the + button and choose Email:
    Workflow Step1
    Workflow Step1 Fields
    We need to configure a few things.
    Let’s use the formula editor for the TO field. Press the formula icon then choose Fields -> Form Name (in my case name is Verify Email Address) -> Email:
    Formula Editor
    Fill out all the other fields.
    In your email content use merge fields to formulate the Verification Code email sent to the user. You can do it using the Fields dropdown.
    The final result should look like this:
    Email Properties
    Save.

  3. Add next step – Form. Choose the Verify Email Form.

  4. Add next step – Conditional.
    For the Conditions Met part enter the following:
    Workflow Conditions
    Make sure the Equals Value is a merge field – the VerCode from the first form.

  5. On the Conditions Met side add new step – Form. Choose the QA Entry. Configure Prefill as following in order to map corresponding fields. This way, the FirstName and LastName will be autopopulated when the form is opened.
    Workflow Mapping

  6. Add next step – Connector. Select the following:
    Select form response action – QA Form
    Select Connector – Salesforce
    Click Configure Connector and enter the following:
    Workflow Connector

  7. Add last step – Redirect to another page:
    Adjust the success page to your needs. I will go with the message: The form has been submitted!

    Save your workflow.

  8. Click the Share button located in the top right corner of your workflow and copy the workflow url.
    For the sake of this example, let’s assume the url is: https://qaformtest.net/hbynkL

5. Add Salesforce Quick Action

Crate a quick action on the Contact object. It should fire the flow that sends an email to the Contact’s email address.
Make sure the email body contains the workflow url appended with the parameter created in step 3 (refId).

Example of final url:
https://qaformtest.net/hbynkL?refId=0032p00003MeyTwBBJ

Where:

  • https://qaformtest.net/hbynkL – workflow url
  • refId – name of the parameter defined in step3
  • 0032p00003MeyTwBBJ – salesforce ContactId

Add the quick action to Contact layout.

6. Test the solution

Go to the record page of the Contact you want to use for testing and trigger quick action.

Send Form Quick Action

Check email:

Form Requested

After opening the link you should see the first form. Click the Send Code button:

Send Code

Enter Code

Check your email to get the code. Enter it in the form:

Email Code

The last form should be displayed:

QA Form Prefilled

Let’s fill out the information.

QA Form Filled

Click Submit.

VoilĂ !

You will be presented with the Success screen:

Form Submitted

Let’s hop back to Salesforce to see what happened there:

Contact Updated

As you can see, the Contact record was updated with information provided in the form.


If you have any questions, feel free to ask in the comment section below. 🙂

Was it helpful? Check out our other great posts here.

Adrian Durlak
Adrian Durlak
Author
Salesforce Developer, passionate about Salesforce characters and mascots (Codey the Bear FTW). Heavily focused on finding the most optimal solutions. Working with Salesforce platform since 2019.