So I need to access a custom CRM group using Liquid. The group has aprox. 20 fields and I need to output around 100 datasets in a custom layout. At the moment I do this with code like this:
{% component groupAlias: "groupname", fieldAlias: "fieldname", entityType: "contact", entityId: "{{item.Id}}", type: "CRMContactCustomGroup" %}
That takes around 2 minutes to load as I have to do around 20 component calls for each of the 100 loops. I would like to speed things up, but using only ONE component call with a collection per loop seems to be daring as I can only access the fields in the collection via their position in the collection array using something like this:
{{crmgroupcollection.fields[13].value}}
The positions of the fields in the array don’t follow the order I set when creating the custom crm group. So my feeling is that this can be changed any time by the team. Hence my hesitation using those.
So is there really no other way to access custom crm group data in a collection?
I have a similar problem. I use the CRM Contact Notes field as a multi-value field to store a copy of any custom CRM fields that have to be displayed quickly.
The Notes field is updated in the Secure Zone Member Registration Form or Member Details Update form via JavaScript. It is pretty quick & allows control of the fields that will be replicated.
It is an overhead, there is data duplication (which has to be managed) so extra work but it gets the job done. All data changes in the CRM are made by the Secure Zone Members using forms from the front end.
It is extensible - more fields can be added as required.
Data can be retrieved in various ways either with a separate snippet for each field or treating the whole as an array.
Eg: Canyoner:true|Joined:2008-03-01T00:00|InDirectory:true|Phone:false
{% assign notesData = member.Notes | split: "|" %}
{% assign canyonData = notesData[0] | split: ":" %}
{% assign joinData = notesData[1] | split: ":" %}
{% assign canyonFlag = canyonData[1] | split: ":" %}
{% assign joinDate = joinData[1] | split: ":" %}
That’s a really cool approach, @peter.medbury! Unfortunately this site is already life and has quite an amount of data in the CRM. I need to find a way to out those quicker. I’m thinking of just looping though each Adavnced CRM item to output the data in an unordered manner, put it in an array and take it from there.
But the trick with using notes is nice. I’ve done similar things a couple of times in eCommerce, when there are more properties than fields available … And it’s also use that in lower plans without Advanced CRM.
@TimL I went with the Notes field solution because looping through the entire CRM, reading the Custom Field data for each CRM identity was just too slow.
I created the summary data in the Notes field by exporting the CRM, creating the Notes field data externally from the data in the CSV & then importing it back into the CRM.