Answers.Body: <p>You will need to create a custom token for this. <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_tokens" rel="nofollow">Hook_civicrm_tokens</a> is where you assign names to your tokens, and <a href="http://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_tokenValues" rel="nofollow">hook_civicrm_tokenValues</a> is where you define the business logic. You will use the API to retrieve the custom field values for each contact, and loop through those values to build your HTML table. Below is an example of the basic API call, for contact 465 to return all the entries for Custom Field 12. Using CustomValue API is a bit different from the others as you'll see from the <code>return.fieldname =&gt; 1</code> bit:</p>
  
  <pre><code>$result = civicrm_api3('CustomValue', 'get', array(
    'sequential' =&gt; 1,
    'entity_id' =&gt; 465,
    'entity_type' =&gt; "Contact",
    'return.custom_12' =&gt; 1,
  ));
  </code></pre>
  
  <p>This is a sample of the result:</p>
  
  <pre><code>{
      "is_error": 0,
      "version": 3,
      "count": 1,
      "id": 12,
      "values": [
          {
              "entity_id": "465",
              "latest": "Hope",
              "id": "12",
              "1": "Life",
              "2": "Hope"
          }
      ]
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-28T07:42:51.983Z
Answers.Text: OK guys; thanks for your help; this coding is a bit too high level for me; will work with someone who knows more about this to configure our particular field sets. Regards, Peter
Answers.UserDisplayName: IT Support Shanti Mission
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-21T13:27:46.637Z
Answers.LastActivityDate: 2015-05-21T13:27:46.637Z
Answers.UserDisplayName: Nicholai
Answers.Body: <p>Tokens do not easily lend themselves to printing out multiple records, since this generally requires extra markup in the output to look the way you want (e.g. an ordered list or a table). However, with a little bit of custom code you could do it.</p>
  
  <p>See <a href="https://civicrm.org/blogs/colemanw/create-your-own-tokens-fun-and-profit" rel="nofollow">Create Your Own Tokens for Fun and Profit</a> for a how-to guide.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-21T19:34:40.397Z
Answers.LastActivityDate: 2015-05-21T19:34:40.397Z
Answers.UserDisplayName: Coleman
Body: <p>I'm looking to print / email groups of contacts with a list of their accreditations which we've stored in a custom field set with multiple records.
  How do we get that to appear on emails &amp; printouts? There is no option on the tokens dropdown.</p>
  
  <p>We want the list to appear in a table format, showing all the entries.</p>
  
  <p>Similar to this support post: <a href="http://forum.civicrm.org/index.php?topic=30029.0" rel="nofollow">http://forum.civicrm.org/index.php?topic=30029.0</a> / I found this post hard to find an answer from.</p>
  
  <p>Any specific ideas? Thanks very much in advance!</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-28T07:34:06.860Z
Comments.Text: OK; so our developer made a custom civicrm extension for us for these tokens.
Comments.UserDisplayName: IT Support Shanti Mission
Tags: <custom-fields><tokens>
Title: Tokens for Custom Field Set with Multiple Records
ThreadText: # Tokens for Custom Field Set with Multiple Records
  
  (Asked by: username_0 on 2015-05-21)
  
  I'm looking to print / email groups of contacts with a list of their accreditations which we've stored in a custom field set with multiple records.
  How do we get that to appear on emails & printouts? There is no option on the tokens dropdown.
  
  We want the list to appear in a table format, showing all the entries.
  
  Similar to this support post: <http://forum.civicrm.org/index.php?topic=30029.0> / I found this post hard to find an answer from.
  
  Any specific ideas? Thanks very much in advance!
  
  **Tags:** custom-fields, tokens
  
  > **Comments:**
  > **username_0**: OK; so our developer made a custom civicrm extension for us for these tokens.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-05-21. Score: 3
  
  You will need to create a custom token for this. Hook_civicrm_tokens is where you assign names to your tokens, and hook_civicrm_tokenValues is where you define the business logic. You will use the API to retrieve the custom field values for each contact, and loop through those values to build your HTML table. Below is an example of the basic API call, for contact 465 to return all the entries for Custom Field 12. Using CustomValue API is a bit different from the others as you'll see from the return.fieldname => 1 bit:
  $result = civicrm_api3('CustomValue', 'get', array(
    'sequential' => 1,
    'entity_id' => 465,
    'entity_type' => "Contact",
    'return.custom_12' => 1,
  ));
  
  This is a sample of the result:
  {
      "is_error": 0,
      "version": 3,
      "count": 1,
      "id": 12,
      "values": [
          {
              "entity_id": "465",
              "latest": "Hope",
              "id": "12",
              "1": "Life",
              "2": "Hope"
          }
      ]
  }
  
  > **Comments:**
  > **username_0**: OK guys; thanks for your help; this coding is a bit too high level for me; will work with someone who knows more about this to configure our particular field sets. Regards, Peter  
  
  ---
  
  ### Answer by username_2 on 2015-05-21. Score: 1
  
  Tokens do not easily lend themselves to printing out multiple records, since this generally requires extra markup in the output to look the way you want (e.g. an ordered list or a table). However, with a little bit of custom code you could do it.
  
  See [Create Your Own Tokens for Fun and Profit](https://civicrm.org/blogs/colemanw/create-your-own-tokens-fun-and-profit) for a how-to guide.
  
  
  ---
  
  