Skip to main content
Skip table of contents

Passing URL Parameters & Pre-Selecting Values

It is possible to pre-fill and pre-select values in the GoMeddo Frontend Builder using either URL Query Parameters or Component Attributes.
Pre-filling or pre-selecting can allow for steps to be skipped automatically (e.g., resource selection, contact entry) and reduce the need for the customer inputting data.

Component Attributes (preferred when you control the markup)

Below is an example of how a pre-selection can be made:

HTML
<gomeddo-frontend-builder
  apiKey="xxxxxxxxxxx"
  developerName="Viewings"
  environment="PRODUCTION"
  backgroundColor="#16072D"
  primaryColor="#9BCFFF"

  <!-- Pre-selection -->
  selectedblueprint="Apartment Viewing"  <!-- Blueprint Name (label) -->
  selectedresource="a1B5g00000EXAMPLE"   <!-- Resource Id -->
  contactid="0035g00000ABC123AAA"        <!-- Salesforce Contact Id -->
>
</gomeddo-frontend-builder>
<script type="module" src="https://frontend.gomeddo.com/gomeddo-frontend-builder.mjs"></script>

Attribute Reference

Attribute Name

Type

Description

Example Value

selectedblueprint

String

Pre-selection of a blueprint by Name, effectively hiding and skipping the Blueprint Selection step.

"Apartment Viewing"

selectedresource

String (Salesforce Id)

Pre-selection of a resource by Id, effectively hiding and skipping the Resource Selection step.

"a1B5g00000EXAMPLE"

contactid

String (Salesforce Id)

Pre-selection of a contact by Id, effectively hiding and skipping the Personal Details step.

"0035g00000ABC123AAA"

preselecteddimensions

String (JSON)

Pre-selection of custom dimensions in Dimension Field Selection steps. Pre-selection will result in hiding and skipping of the related Dimension Field Selection Step.

The JSON needs to be converted to a string and cannot be passed as is.

NONE
"{
  "B25__Staff__c": "a11a5000005kPLxXXX",
  "Project__c": "a11a5000005kPLxXXX",
};"

You can find an example also pre-selecting custom dimensions in the Examples section.

URL Query Parameters (preferred for links, emails, campaigns)

Below is an example of how a pre-selection can be made:

HTML
<a href="https://yourapp.example/book?selectedresource=a1B5g00000EXAMPLE
  &selectedblueprint=Apartment%20Viewing
  &contactid=0035g00000ABC123AAA">
  Book now
</a>

The component automatically reads the query parameter names from the URL. If both query parameters (URL) and attributes are provided, URL query parameters take precedence (so you can override defaults per link).

It is important that values passed using query parameters are properly URL encoded as it could interfere with the URL otherwise, resulting in partial pre-selection.

Parameter Reference

Parameter Name

Type

Description

Example Value

gm_blueprint_name

String

Pre-selection of a blueprint by Name, effectively hiding and skipping the Blueprint Selection step.

"Apartment%20Viewing"
Properly URL Encoded

gm_resource_id

String (Salesforce Id)

Pre-selection of a resource by Id, effectively hiding and skipping the Resource Selection step.

"a1B5g00000EXAMPLE"

gm_contact_id

String (Salesforce Id)

Pre-selection of a contact by Id, effectively hiding and skipping the Personal Details step.

"0035g00000ABC123AAA"

Pre-selecting custom dimensions using query parameters is not support, this can be achieved by retrieving the attributes from the URL yourself, building a JSON object and passing it to the preselecteddimensions attribute. See example.

Notes

  • Salesforce IDs: Use 18-char case-safe IDs when possible (e.g., 0035g00000ABC123AAA).

  • Blueprint: Provide the name/label exactly as configured in the GoMeddo Frontend Builder.

  • All query parameters and attributes names are lowercase.

Examples

Pre-selecting custom dimensions (hard coded)

HTML
<gomeddo-frontend-builder
  apiKey="xxxxxxxxxxx"
  developerName="Viewings"
  environment="PRODUCTION"
  backgroundColor="#16072D"
  primaryColor="#9BCFFF"

  <!-- Pre-selection -->
  selectedblueprint="Apartment Viewing"  <!-- Blueprint Name (label) -->
  selectedresource="a1B5g00000EXAMPLE"   <!-- Resource Id -->
  contactid="0035g00000ABC123AAA"        <!-- Salesforce Contact Id -->
  preselecteddimensions="{
    "B25__Staff__c": "a11a5000005kPLxXXX",
    "Project__c": "a11a5000005kPLxXXX",
  };" <!-- String representation of a JSON Object -->
>
</gomeddo-frontend-builder>
<script type="module" src="https://frontend.gomeddo.com/gomeddo-frontend-builder.mjs"></script>

Pre-selecting custom dimensions (get from URL)

JS
<gomeddo-frontend-builder
  apiKey="xxxxxxxxxxx"
  developerName="Viewings"
  environment="PRODUCTION"
  backgroundColor="#16072D"
  primaryColor="#9BCFFF"

  <!-- Pre-selection -->
  selectedblueprint="Apartment Viewing"  <!-- Blueprint Name (label) -->
  selectedresource="a1B5g00000EXAMPLE"   <!-- Resource Id -->
  contactid="0035g00000ABC123AAA"        <!-- Salesforce Contact Id -->
>
</gomeddo-frontend-builder>
<script type="module" src="https://frontend.gomeddo.com/gomeddo-frontend-builder.mjs"></script>
<script type="text/javascript">
  // We need to wait for the DOM to load (element has been rendered on the page)
  document.addEventListener("DOMContentLoaded", function () {
    const preselectedDimensions = {};
  
    // Get query parameter value
    const urlParams = new URLSearchParams(window.location.search);
    const selectedStaff = urlParams.get("my_selected_staff"); 
    // We used "my_selected_staff" for but it can be anything of your choosing as long as it is unique.
  
    if (selectedStaff) {
      preselectedDimensions["B25__Staff__c"] = selectedStaff;
    }
  
    const frontendBuilderElement = document.querySelector("gomeddo-frontend-builder");
    frontendBuilderElement.setAttribute("preselecteddimensions", JSON.stringify(preselectedDimensions));
  });
</script>

Make sure to use JSON.stringify when passing your pre-selected dimensions.

Deep-link from Salesforce (Contact detail page button)

Create a button/URL formula that passes the Contact Id:

CODE
https://yourapp.example/book?gm_contact_id={!Contact.Id}

Marketing email campaign (fixed blueprint, variable contact)

CODE
https://yourapp.example/book?gm_blueprint_name=Consultation&gm_contact_id={{ sf_contact_id }}

Validation & Error Handling

  • Contact Id (contactid or gm_contact_id) must be a valid Salesforce Contact. For privacy and security reason, the Contact Id provided is not validated against your Salesforce Org, if the record does not exist or is inaccessible, the step will still be skipped, the reservation will fail to be created.

  • Resource Id (selectedresource or gm_resource_id) must match an existing resource that is available under the chosen blueprint/timeframe. For privacy and security reason, the Resource Id provided is not validated against your Salesforce Org, if the record does not exist or is inaccessible, the step will still be skipped, the reservation will fail to be created.

  • Blueprint Name (selectedblueprint or gm_blueprint_name) must match exactly (case-sensitive depending on your configuration) the name of an existing Blueprint. If there is no match, the Blueprint Selection step will appear.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.