Pass a SOQL Filter using a URL Parameter
Example Scenario: We've created a form that is mapped to a Custom Object, Post Event Survey and the Attendee ID field included in the Field Group. We'd like to send out the Post Event Survey Form to our event attendees so they can complete the survey and associate their responses with their Attendee Record ID. However, the attendees do not have login credentials to the Community Portal, so we cannot map the SOQL Filter directly in the Form itself. This requires the SOQL query be converted to a URL parameter. It will allow us to create a unique URL for each attendee that they can use to complete the form. This unique URL will map their responses to their unique Attendee ID without having to log in to the portal.
- From the form record's Detail page, click Related to access the Field Groups related list.
- Click the link for the desired Field Group. This will open the Field Group Detail page.
- From the Field Group Detail page, in the URL, copy the Field Group ID. (This is the number at the end of the URL.)
- Paste the Field Group ID into a document or notepad to use later.
Return to the existing Form's Detail page and copy the Form URL.
If you do not see this field, edit your page layout to display it.
Paste the Form URL into a document or notepad to use later.
If you have not created the Form URL field yet, you will need to create a fomula text field:
When creating the field, the formula for the field should be: "https://yourcommunityurl/cpbase__form?id=" & Id
Example: "" & Id
- Add an & after the Form URL. For example:
- Append the following to the end of the Field Group ID_SOQL= For example: a0O46000000T9ef_SOQL=
- For example: AttendeeID= 'a0M610000005KbY'
Encode the SOQL query by navigating to http://meyerweb.com/eric/tools/dencoder/. This is done by [Pasting] the SOQL Filter (Id= 'a0M610000005KbY') into the Encoder and clicking the Encode button. Copy the Encoded SOQL Filter to use in next step.
Before Encoding: Id= 'a0M610000005KbY'
After Encoding: Id%3D%20%27a0M610000005KbY%27
Create your Unique Form URL by adding the Form URL, the Field Group, and encoded SOQL filter together. The Formula is FormURL& + Field Group ID_SOQL= + Encoded SOQL filter.
For example, &a0O46000000T9d8_SOQL=Id%3D%20%27a0M610000005KbY%27
You have now created a unique form url that connects to a specific attendee ID without having the user login to the portal.