CRM Contacts
This component fetches CRM Record data to use on the front-end via Liquid.
{% component type: "CRMContacts" %}
Due to GDPR and privacy regulations CRM contact records 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.
Parameters and Options
CRMContacts
This is the name of the entity that needs to be used for the component retrieving function.
<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).
Id
Email
FirstName
LastName
...and any other properties available for the module
Remove spaces from custom property names here.
<your value>
Liquid variables can be used here also. If present but no value set, no items will be returned.
Id
Email
FirstName
LastName
...and any other properties available for the module
Remove spaces from custom property names here.
ASC (default)
DESC
ASC
sorts the items in ascending order while DESC
sorts in descending order (based on alpha/numeric or date sorting).If empty or not present, alpha/numeric sorting will be used.
10 (default)
<number>
0 (default)
<number>
<yourLiquidVariableName>
Your collectionVariable value must only contain English letters, numbers or underscores. Spaces or special characters are not supported.
Liquid Output
The below example has 2 sample items
(as these records have data viewing enabled) but is otherwise the default structure you will get from this Component.
{
"items": [
{
"Id": 17,
"Email": "alextest@test.com",
"FirstName": "Alex",
"LastName": "Smith",
"Address": "",
"City": "",
"State": "",
"ZipCode": "",
"Country": "",
"Site": "",
"Phone": "",
"Status": "",
"Notes": "",
"Type": "Wholesaler",
"CreatedDateTime": "2019-06-12T23:28:59.07",
"UpdatedDateTime": "2020-08-07T12:56:27.713",
"SecureZones": []
},
{
"Id": 1,
"Email": "joetest@test.com",
"FirstName": "Joe",
"LastName": "Test",
"Address": "1 Street St",
"City": "Streetville",
"State": "NSW",
"ZipCode": "2000",
"Country": "Australia",
"Site": "",
"Phone": "12340987",
"Status": "",
"Notes": "",
"Type": "Consumer",
"CreatedDateTime": "2018-11-25T18:04:18.863",
"UpdatedDateTime": "2020-09-24T13:23:56.457",
"SecureZones": []
}
],
"Params": {
"type": "CRMContacts",
"collectionVariable": "enabledContacts",
"layout": ""
}
}
Virtual Layout
Based on the above example, if not using any custom layout or collection, the default virtual layout will output as a summary list of Contact, eg:
<ul>
{% for contact in this.items %}
<li>{{contact.FirstName}} {{contact.LastName}} - {{contact.Email}}</li>
{% endfor %}
</ul>
Rendering the list:
- Alex Smith - alextest@test.com
- Joe Test - joetest@test.com
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 "enabledContacts":
{% component type: "CRMContacts", collectionVariable: "enabledContacts" %}
Accessing a specific item within the collection. In this case the second item (zero based index), which in our example would render the value Test
{{enabledContacts.items[1]['lastname']}}
Related Articles
- Contacts
- Custom Reports
- Form Submissions
- Event Bookings
- Orders
- Advanced CRM Groups
- CRMCustomGroup
This component fetches Advanced CRM Group data attached to CRM Records, Cases, Orders or Event Bookings.
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.