Change Log

  • 28-Oct-2020 | 5.6.0 | Changed component name from 'CRMContactCustomGroup' to 'CRMCustomGroup'
  • All new article

Contributors:

Adam Wilson - Logo Pogo

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

Parameter
Values
Required
Description
type
CRMCustomGroup

This is the name of the entity that needs to be used for the component retrieving function.

groupAlias
<YourGroupAlias>
The Custom Group alias name that the data is to be sourced from.
fieldAlias
<YourFieldAlias>

Use this parameter to retrieve just one individual field from the specified group.

This value is case sensitive.

entityType
contact (default)
form_submission
event_booking
order

The type of CRM record the Custom Group is attached to.
entityId
<ContactID> (default)
<FormSubmissionID>
<EventBookingID>
<OrderID>
The ID of the entityType item

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.

layout
<path/to/layout>

Path to file that will contain the Liquid layout content to be parsed.

If an empty string, nothing will be rendered.
If paramater is not included, the default virtual layout will be rendered (see below).

collectionVariable
<yourLiquidVariableName>

Assigns the data to a Liquid collection enabling further access to the data on the Page or Template using Liquid.

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:

MyBiz

Accessing 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']}}