CRMCustomGroup
This component fetches Advanced CRM Group data attached to CRM Records, Cases, Orders or Event Bookings.
{% component type: "CRMCustomGroup", groupAlias: "<YOUR CUSTOM GROUP ALIAS>" %}
Due to GDPR and privacy regulation CRM contact records will only be output by this component if the "Allow listing my contact data in the CMS" option has been enabled. This option can only be checked by the user during the submission of the "Update Account Form" or a web Form with the "Allow listing my contact data in the CMS" field added to it.
Parameters and Options
CRMCustomGroup
This is the name of the entity that needs to be used for the component retrieving function.
<YourGroupAlias>
<YourFieldAlias>
This value is case sensitive.
contact (default)
form_submission
event_booking
order
<ContactID> (default)
<FormSubmissionID>
<EventBookingID>
<OrderID>
If an empty string or not included, no data will be returned, unless the entityType is set as contact
and the user is logged in - in which case the user's CRM ID will be used by default.
Due to GDPR and privacy regulations, Custom Group fields from an entityType of contact
, will only be output by this component if the 'Allow listing my contact data in the CMS' option has been enabled in the users CRM record. This option can only be checked by the user during the submission of the 'Update Account Form' or a web Form with the 'Allow listing my contact data in the CMS' field added to it.
<path/to/layout>
If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).
<yourLiquidVariableName>
Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
Liquid Output
The below example is the full Custom Group called "Company" attached to a CRM contact (as this contact record has data viewing enabled), which provides additional data fields for company information, but is otherwise the default structure you will get from this Component.
{
"Fields": [
{
"Name": "Name",
"Alias": "Name",
"CaseFieldType": 7,
"Value": "MyBiz",
"ArrayValue": [
"MyBiz"
]
},
{
"Name": "Business Number",
"Alias": "BusinessNumber",
"CaseFieldType": 7,
"Value": "987654321",
"ArrayValue": [
"987654321"
]
},
{
"Name": "Type",
"Alias": "Type",
"CaseFieldType": 3,
"Value": "Client",
"ArrayValue": [
"Client"
]
}
],
"Alias": "company",
"Params": {
"type": "CRMCustomGroup",
"collectionvariable": "CustomGroup",
"groupalias": "company",
"entityid": "1430",
"layout": ""
}
}
Virtual Layout
Based on the above example, if not using any custom layout or collection, the default virtual layout will output the value of just the first field, eg:
{{this.fields[0]['value']}}
Rendering the value:
MyBizAccessing the Data
JSON Output
You can output the full JSON for your component data by referencing the root Liquid object {{this}}
in your module’s layouts, or directly on your page, if using the collectionVariable
parameter in your component tag.
For example:
{% component type: ... collectionVariable: "myData" %}
You can then render the JSON like so:
{{myData}}
For more details on using this approach, see Part 2 of the free ‘Learning Liquid Course’.
Rendering Property Values
This data is also accessible directly on the Page or Template via a Liquid Collection by adding collectionVariable
to the Component.
An example using collectionVariable
with value "CustomGroup":
{% component type: "CRMCustomGroup", groupAlias: "company", entityId: "1430", collectionVariable: "CustomGroup" %}
Accessing a specific item within the collection. In this case the third item (zero based index), which in our example would render the value Client
{{CustomGroup.fields[2]['value']}}