One of my favorite ways to bring the programmer’s mantra of Don’t Repeat Yourself! (DRY) into my Salesforce work is to build the One Form To Rule Them All.
By playing with URL parameters you can take a simple form and use it more than once.
A single Field Trip Form that can be used for any and all field trips throughout the year.
A single Pre/Post Survey
A multi-purpose Waiver form
And so much more.
The trick here—the little mental shift that can really open up possibilities—is that “questions” on the form can be used as the text or content.
Let me say that again: Questions on the form can be text, instructions, or content of the form, rather than something you are asking the user to fill out.
Then you put the values you want in those questions into the URL that you send out and—BAM!—the form is customized. Saves time (and time is money) building and managing webforms.
Works with Any Form Tool
You should be able to do this with just about any form tool because all you’re using is URL parameters. My tool of choice is usually FormAssembly. But URL prefill is pretty standard functionality and should be available with most form tools.
(I’ve written here about FormAssembly’s prefill connector and the amazing powers it can bring to bear. But that’s not what we’re doing here.)
The Master Field Trip Form
Let me use The Academy Group to show an example. They take their students on lots of field journeys and they want to get consent each time, notifying parents/guardians about where the kids will be and what they’ll be doing. It was such a pain to create a whole new form for each trip.
But now they have the Master Field Trip form. All they have to do is customize the URL they’re sending out and the form works for every trip. I have a simplified example form for us to look at in my FormAssembly account. If you go to the form without anything added to the URL it’s not very useful.
But if you use this format to customize the URL you can do all sorts of things:
https://www.tfaforms.com/5037437?tfa_1=[reason for trip]&tfa_23=[location]
Replace the bracketed sections with your desired text and it goes into the fields. (The tfa_# references tell the form which questions to put the text into. You’ll have a similar syntax for other form tools.)
You can fill more than just two fields if you need to. (URLs do have a maximum length of 2,048 characters, so don’t write a novel in your prefill. But if you’re being reasonable you can do quite a lot.)
Here’s an awesome field trip that I would highly recommend based on my own recent travels.
The URL is:
https://www.tfaforms.com/5037437?tfa_1=To see the ice cave, learn about the unique geology of Iceland, and get an introduction to the Northern Lights. We will eat lunch in the rotating cafe with a view overlooking the city.&tfa_23=Perlán Science Museum, Reykjavik, Iceland
But you can use the same form for a more realistic trip.
This URL is:
https://www.tfaforms.com/5037437?tfa_1=To visit a local business.&tfa_23=Mike’s Sandwich Shop, 123 Main St. )
You can create all sorts of waivers, permission slips, and notifications this way.
Pre/Post Survey In One
Now let’s look at one more example that can really save time: Use the same form for both a pre- and a post-program survey.
To measure program effectiveness you usually want to ask program participants the same questions before and after, in order to measure the effect of our intervention. You might think you would want to build two different forms for this. But Don’t Repeat Yourself! If you have two forms and then you decide to add a question, you have to modify two forms.
Instead, if at all possible, I want to use the same form for both pre and post. All that’s going to take is:
A dropdown menu question for Pre or Post. (You can probably hide this question.)
Setting the value of that question via the URL.
(Optional) Conditionally hide or display different instructions or even questions that are used only in the pre or post context, questions based on the value of Pre/Post.
See what I mean here.
Don’t Repeat Yourself in the Connector Either
I don’t want to go too deeply into the step of sending your form data to Salesforce. In fact, this trick doesn’t necessarily assume you’re doing anything more with your form data than having the responses sit on your form provider’s server.
But if you are building a connector to send the data into Salesforce, keep the same DRY principles in mind. You can map the question that you prefilled into the created record, for example, as the name of the field trip this permission was for. Or if you need a more succinct name, you could use an hidden prefilled field (“Perlán Trip, Iceland.")