Website forms, or webforms, or just forms, are awesome. They allow you to easily collect information from people who may or may not exist in Salesforce.

They often come with a built-in native Salesforce connector, allowing you to submit data to one or multiple objects (often the Contact, Account, and Opportunity).

The architecture looks like this:

With simple use cases, such as a signup form, it makes sense to use this built-in connector. However, once you need to connect to multiple objects or complex objects, then an staging object makes sense.

For example, a client of mine had a use case in which one form submission needed to

  • Create a Contact, unless an existing Contact matches by email address
  • Create an Account, for the Contact’s place of work
  • Add the Contact as 3 Campaign Members, for multiple newsletter subscriptions

The native connector could handle a single Campaign Member, but not multiple. So we designed and built the following architecture:

Key points:

  • Form submissions would be sent to a custom object called Form Submission
  • Using an after-save record-triggered flow on this object, we could split the aggregated data into any number of records
  • Business rules for contact matching would need to be replicated, but that’s easy in flow
  • You now have a copy of all submitted forms in Salesforce, for historical and re-processing purposes

The takeaway
When using a form, consider whether it makes sense to use the native connector to connect to a single or a couple of objects. When the requirements are more challenging, using a staging object to help split up the submitted data.

Category:
Salesforce