Locations Element
Overview
The Locations Element is a list element that will display all Locations within a Company. List elements are used for the purposes of a user selection. When a user selects a Location, the clickLocation event listener will trigger returning all of the Location details.
The Locations Element clickLocation event listener can be used to mount the Location Setup Element and display an edit form for internal purposes, or to capture the ID of the Location selected for the Availability Element.
To provide a search bar in order to collect customer input for element results please see the Location Search Element. Please see below for the optional parameters that are to be provided to this element, custom events included with the element, a code sample for the element, and screenshot before any additional style sheet is provided.
Custom Events
- getLocations
The Get Locations custom event returns when the API request toGET /locations
has returned with a response. The response in its entirety is then accessible within the event object in a nested object named detail. - clickLocation
The Click Location custom event returns immediately with the details of the location selected. The ID of this location can then be stored and used in other elements in order to reference the user selection.
Syntax
Below is a basic syntax for loading the Locations Element. This example uses IDs from our public sandbox profile, to integrate this example into your own booking page copy the IDs from your Dashboard profile and replace with the IDs in the example below.
Parameters
name
String
Specifies the Location name (full or partial)
nearestTo
String
Search by distance nearest Geo-coordinates, City, Postal/Zip Code
proximity
integer($int32)
Specifies the maximum distance to display
units
String
Distance either imperial(miles), metric(kilometers)
serviceId
String
Locations that offer this service
friendlyId
String
Frienldy Id of location
regionId
String
Locations within a specific region
ignorePrimary
Boolean
Don't include the Primary Location
offset
integer($int32)
Starting row of page, default 0
limit
integer($int32)
Page limit, default 20, max 100
Options
search
Boolean
Displays a search bar for the user to search Locations
searchBy
String
Defines the query parameter that will by included in the Rest API GET
request Default: name. See below for a list of all possible query parameters for the GET
Locations endpoint:
name
String
Location name (full or partial)nearestTo
String
Search by distance nearest Geocoords, City, Postal/Zip Codeproximity
Integer($int32)
Maximum distance to displayunits
String
Distance either imperial(miles), metric(kilometers)serviceId
String
Locations that offer this servicefriendlyId
String
Frienldy Id of locationregionId
String
Locations within a specific regionignorePrimary
Boolean
Don't include the Primary Location. Default: falseoffset
Integer($int32)
Starting row of page. Default 0limit
Integer($int32)
Page limit, default 20, max 100
Updated about 1 year ago