We often get requests from our nonprofit clients to display Salesforce records as a list in an online form.  These online forms might be used for logging attendance, registering for classes, signing up for conference seminars or updating family member information. Let’s look at a real life example of using lists in an online form from one of our clients.

The Baan Dek Foundation educates children of immigrant workers in Thailand. They use the form below to log attendance at their educational sessions in the field on Android tablets. The form is built using Form Assembly, which they’ve configured to integrate with their Salesforce instance. Click here to read more about the Baan Dek Foundation project.

Attendance Form Example 1

Below is another example of an attendance form.

Attendance Form 2

You can create a beautiful form like this using repeatable sections in Form Assembly. Note, this article is intended for advanced System Administrators who are familiar with Form Assembly’s Salesforce Connectors. Read on for the details and how-tos. 

Use Case

ACME Org is using a Campaign record in Salesforce to represent a breakfast event this month. They have five Campaign Members with a status of RSVP Yes and they want the Event Manager to log the actual attendance on-site at the event. Once the attendance is logged and submitted the form should update the Campaign Member status to Attended in Salesforce. Here’s how to set it up.

Step 1 – Form Builder

Start by creating a form in Form Assembly with a section called Campaign Member, which will be repeated for each Campaign Member in our Campaign. To set this up, add a new section to your form and click on the blue Options button. In the Repeatable Option menu within the left sidebar, check This is a repeatable section.

Form Builder

Next, add three fields to this new section:

  • Status Checkbox – Use a single checkbox to mark attendance
  • Name – This will prefill with the Contact’s full name
  • Campaign Member ID – We’ll pre-fill and hide this field so that we know which Campaign Member to update in the post-fill connector.

Add Fields to Repeatable Section

That section doesn’t look so pretty, so we’ll fix up the look of the form by making the following adjustments to the Campaign Member repeatable section:

Presentation Settings

The form should look like this:

Form Builder Step 3

 

Step 2 – Salesforce Prefill Connector

Now let’s navigate to the Connectors menu in the left sidebar of Form Assembly and add a Salesforce Prefill Connector as shown below.

Connectors (Prefill)

Below are the configurations for our prefill connector. We’re pulling all Campaign Members with a status of RSVP Yes from a Campaign specified through the url. For more details on this feature, check out Form Assembly’s documentation on the Salesforce Prefill Connector.

Prefill Connector Settings

Next, we’ll need to map our two fields from the Salesforce Campaign Member record to our form’s repeatable section.

Prefill Field Mappings

That’s it for the prefill connector. Use your prefill url – like this -> https://www.tfaforms.com/455234?caid=701B00000009dAxIAI – to test your form so far. Lookin’ good! But it doesn’t actually do anything yet, so let’s head on to step 3.

Attendance Form Final

 

Step 3 – Salesforce Post-fill Connector

Next, we’ll add a post-fill connector to send data back to Salesforce. Form Assembly just calls this connector a Salesforce Connector but I will refer to it as the post-fill connector to distinguish between the prefill (on form load) and post-fill (on submission) connectors.

Connectors (Post Fill)

Below are the configurations for this connector.

Postfill Connector Settings

This post-fill connector is relatively straightforward except for one little hack. You may have noticed that we’re looking up records where the Salesforce field True (Form Assembly) equals the Status field in our form. What the heck? This is indeed a tricky little hack, so let me explain.

The most logical way to handle these Campaign Member record updates would be to use the Form Assembly Skip If feature to update records only if the Attended checkbox is checked. Although that’s a nice clean and logical approach, the reality is that the Skip If feature does not work with repeatable sections. This is a known limitation in the Form Assembly Salesforce Connector which will hopefully be resolved one day. In the meantime, we have to get clever…

What we’ve done is add a permanently true checkbox to the Campaign Member record called True (Form Assembly). That field allows us to say “Lookup a Campaign Member record where the ID matches AND the Attended checkbox in my form matches the permanently true checkbox on the record.” This is the same thing as a Skip If formula, but in a bit more convoluted kind of way.

Once  you’ve wrapped your head around the purpose of the True (Form Assembly) checkbox, you’ll need to create it in Salesforce. Here are the steps to do that:

How to Create the True (Form Assembly) Checkbox

  1. Navigate to the Campaign Member object
  2. Create a new checkbox field with the name True (Form Assembly)
  3. Set the default value to true
  4. Mass update this checkbox field on all of your existing records. I recommend using a tool such as Apsona to make this quick mass update across your entire org.

Some of you might be scratching your head thinking “Why didn’t we just create a formula field which is always true rather than a checkbox field?” Good thinking! I tried that too, but unfortunately we can’t use a formula field in a lookup criteria step in Form Assembly. That is a technical limitation.

After you’ve setup your post-fill connector the way we’ve shown above, you’re ready to test out your form. Give it a try. Once you submit, your Campaign Member statuses should get updated automatically:

Campagin Member List View

Success!

This Form Assembly feature of pre-filling a list of records with Salesforce data and the ability to update certain records from that list can be replicated on many different standard and/or custom objects for different use cases. If you have further ideas, we’d love to hear how you might want to use this functionality for your own organization!

Happy Form Building.