CRMContactCustomGroup

This component fetches Advanced CRM Group data attached to CRM Records, Cases, Orders or Event Bookings.

{% component type: "CRMContactCustomGroup", 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".

Parameters and Options

Parameter Values Required Description
type CRMContactCustomGroup

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".

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.

{
  "Alias": "company",
  "Fields": [
  {
    "Name": "Name",
    "Alias": "Name",
    "Value": "MyBiz"
  },
  {
    "Name": "Business Number",
    "Alias": "BusinessNumber",
    "Value": "987654321"
  },
  {
    "Name": "Type",
    "Alias": "Type",
    "Value": "Client"
  }
]
}

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

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: "CRMContactCustomGroup", groupAlias: "company", entityId: "1", 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']}}


Related Articles

External Resources

There are currently no external resources available.

Please let us know if you have any other contributions or know of any helpful resources you'd like to see added here.


Questions?

We are always happy to help with any questions you may have.
Visit the Treepl Forum for community support and to search previously asked questions or send us a message at support@treepl.co and we will consult you as soon as possible.