Answers.Body: <p>I had this need recently, and found CiviGrant doesn't have native token support.</p>
  <p>However, it took only a few minutes with the <a href="https://civicrm.org/extensions/searchkit-tokens" rel="nofollow noreferrer">SearchKit Tokens</a> extension to create grant tokens.</p>
  <p>Install that extension, then you can go to <strong>Search menu » SearchKit</strong> and press the <strong>Import</strong> button.  Paste in the text below to get tokens for all your core fields.</p>
  <p>If you want to add tokens for custom fields:</p>
  <ul>
  <li>Go to <strong>Search » SearchKit</strong></li>
  <li>Click the <strong>pencil</strong> icon next to <em>Grant Tokens</em>.</li>
  <li>On the <strong>Select Fields</strong> tab, add any new fields you'd like.</li>
  <li>Click on the <strong>grant</strong> display.</li>
  <li>Click <strong>Add/Remove Fields</strong> and select the field(s) you just added.</li>
  <li>Scroll down in the list and set a <em>Token Label</em>.  That's the name as they will appear in the token browser.</li>
  </ul>
  <pre><code>[
    [
      &quot;SavedSearch&quot;,
      &quot;save&quot;,
      {
        &quot;records&quot;: [
          {
            &quot;name&quot;: &quot;Grant_Tokens&quot;,
            &quot;label&quot;: &quot;Grant Tokens&quot;,
            &quot;api_entity&quot;: &quot;Grant&quot;,
            &quot;api_params&quot;: {
              &quot;version&quot;: 4,
              &quot;select&quot;: [
                &quot;id&quot;,
                &quot;grant_type_id:label&quot;,
                &quot;financial_type_id:label&quot;,
                &quot;amount_granted&quot;,
                &quot;amount_requested&quot;,
                &quot;application_received_date&quot;,
                &quot;contact_id&quot;,
                &quot;decision_date&quot;,
                &quot;currency:label&quot;,
                &quot;money_transfer_date&quot;,
                &quot;rationale&quot;,
                &quot;grant_due_date&quot;,
                &quot;grant_report_received&quot;,
                &quot;status_id:label&quot;,
                &quot;amount_total&quot;
              ],
              &quot;orderBy&quot;: [],
              &quot;where&quot;: [],
              &quot;groupBy&quot;: [],
              &quot;join&quot;: [],
              &quot;having&quot;: []
            }
          }
        ],
        &quot;match&quot;: [
          &quot;name&quot;
        ]
      }
    ],
    [
      &quot;SearchDisplay&quot;,
      &quot;save&quot;,
      {
        &quot;records&quot;: [
          {
            &quot;name&quot;: &quot;Grant_Tokens_Tokens_1&quot;,
            &quot;label&quot;: &quot;grant&quot;,
            &quot;saved_search_id.name&quot;: &quot;Grant_Tokens&quot;,
            &quot;type&quot;: &quot;tokens&quot;,
            &quot;settings&quot;: {
              &quot;columns&quot;: [
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;id&quot;,
                  &quot;dataType&quot;: &quot;Integer&quot;,
                  &quot;label&quot;: &quot;ID&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;grant_type_id:label&quot;,
                  &quot;dataType&quot;: &quot;Integer&quot;,
                  &quot;label&quot;: &quot;Grant Type&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;financial_type_id:label&quot;,
                  &quot;dataType&quot;: &quot;Integer&quot;,
                  &quot;label&quot;: &quot;Financial Type&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;amount_granted&quot;,
                  &quot;dataType&quot;: &quot;Money&quot;,
                  &quot;label&quot;: &quot;Amount Granted&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;amount_requested&quot;,
                  &quot;dataType&quot;: &quot;Money&quot;,
                  &quot;label&quot;: &quot;Amount Requested&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;application_received_date&quot;,
                  &quot;dataType&quot;: &quot;Date&quot;,
                  &quot;label&quot;: &quot;Application Received Date&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;contact_id&quot;,
                  &quot;dataType&quot;: &quot;Integer&quot;,
                  &quot;label&quot;: &quot;Contact ID&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;decision_date&quot;,
                  &quot;dataType&quot;: &quot;Date&quot;,
                  &quot;label&quot;: &quot;Decision Date&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;currency:label&quot;,
                  &quot;dataType&quot;: &quot;String&quot;,
                  &quot;label&quot;: &quot;Currency&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;money_transfer_date&quot;,
                  &quot;dataType&quot;: &quot;Date&quot;,
                  &quot;label&quot;: &quot;Grant Money Transfer Date&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;rationale&quot;,
                  &quot;dataType&quot;: &quot;Text&quot;,
                  &quot;label&quot;: &quot;Grant Rationale&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;grant_due_date&quot;,
                  &quot;dataType&quot;: &quot;Date&quot;,
                  &quot;label&quot;: &quot;Grant Report Due Date&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;grant_report_received&quot;,
                  &quot;dataType&quot;: &quot;Boolean&quot;,
                  &quot;label&quot;: &quot;Grant Report Received&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;status_id:label&quot;,
                  &quot;dataType&quot;: &quot;Integer&quot;,
                  &quot;label&quot;: &quot;Grant Status&quot;
                },
                {
                  &quot;type&quot;: &quot;field&quot;,
                  &quot;key&quot;: &quot;amount_total&quot;,
                  &quot;dataType&quot;: &quot;Money&quot;,
                  &quot;label&quot;: &quot;Total Amount&quot;
                }
              ]
            }
          }
        ],
        &quot;match&quot;: [
          &quot;saved_search_id&quot;,
          &quot;name&quot;
        ]
      }
    ]
  ]
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-16T19:31:26.163Z
Answers.LastActivityDate: 2024-04-16T19:31:26.163Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>If the tokens for grants are not available in core (which I can imagine) and appartently the data-processor tokens extension does not work with them either, the option you have left is to create an extension that adds them as custom tokens.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-02T20:31:33.540Z
Answers.Text: or add to https://github.com/eileenmcnaughton/nz.co.fuzion.civitoken
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-02T08:09:37.760Z
Answers.LastActivityDate: 2020-07-02T08:09:37.760Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>What is the best way of getting fields from grants available as tokens for mail/PDF-merge?</p>
  <p>No native tokens?
  Not available in form processor extension?</p>
  
Tags: <tokens><civigrant>
Title: Fields from CiviGrant as tokens?
ThreadText: # Fields from CiviGrant as tokens?
  
  (Asked by: username_0 on 2020-07-01)
  
  What is the best way of getting fields from grants available as tokens for mail/PDF-merge?
  
  No native tokens?
  Not available in form processor extension?
  
  **Tags:** tokens, civigrant
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2024-04-16. Score: 1
  
  I had this need recently, and found CiviGrant doesn't have native token support.
  
  However, it took only a few minutes with the [SearchKit Tokens](https://civicrm.org/extensions/searchkit-tokens) extension to create grant tokens.
  
  Install that extension, then you can go to **Search menu » SearchKit** and press the **Import** button. Paste in the text below to get tokens for all your core fields.
  
  If you want to add tokens for custom fields:
  
  * Go to **Search » SearchKit**
  * Click the **pencil** icon next to *Grant Tokens*.
  * On the **Select Fields** tab, add any new fields you'd like.
  * Click on the **grant** display.
  * Click **Add/Remove Fields** and select the field(s) you just added.
  * Scroll down in the list and set a *Token Label*. That's the name as they will appear in the token browser.
  
  ```
  [
    [
      "SavedSearch",
      "save",
      {
        "records": [
          {
            "name": "Grant_Tokens",
            "label": "Grant Tokens",
            "api_entity": "Grant",
            "api_params": {
              "version": 4,
              "select": [
                "id",
                "grant_type_id:label",
                "financial_type_id:label",
                "amount_granted",
                "amount_requested",
                "application_received_date",
                "contact_id",
                "decision_date",
                "currency:label",
                "money_transfer_date",
                "rationale",
                "grant_due_date",
                "grant_report_received",
                "status_id:label",
                "amount_total"
              ],
              "orderBy": [],
              "where": [],
              "groupBy": [],
              "join": [],
              "having": []
            }
          }
        ],
        "match": [
          "name"
        ]
      }
    ],
    [
      "SearchDisplay",
      "save",
      {
        "records": [
          {
            "name": "Grant_Tokens_Tokens_1",
            "label": "grant",
            "saved_search_id.name": "Grant_Tokens",
            "type": "tokens",
            "settings": {
              "columns": [
                {
                  "type": "field",
                  "key": "id",
                  "dataType": "Integer",
                  "label": "ID"
                },
                {
                  "type": "field",
                  "key": "grant_type_id:label",
                  "dataType": "Integer",
                  "label": "Grant Type"
                },
                {
                  "type": "field",
                  "key": "financial_type_id:label",
                  "dataType": "Integer",
                  "label": "Financial Type"
                },
                {
                  "type": "field",
                  "key": "amount_granted",
                  "dataType": "Money",
                  "label": "Amount Granted"
                },
                {
                  "type": "field",
                  "key": "amount_requested",
                  "dataType": "Money",
                  "label": "Amount Requested"
                },
                {
                  "type": "field",
                  "key": "application_received_date",
                  "dataType": "Date",
                  "label": "Application Received Date"
                },
                {
                  "type": "field",
                  "key": "contact_id",
                  "dataType": "Integer",
                  "label": "Contact ID"
                },
                {
                  "type": "field",
                  "key": "decision_date",
                  "dataType": "Date",
                  "label": "Decision Date"
                },
                {
                  "type": "field",
                  "key": "currency:label",
                  "dataType": "String",
                  "label": "Currency"
                },
                {
                  "type": "field",
                  "key": "money_transfer_date",
                  "dataType": "Date",
                  "label": "Grant Money Transfer Date"
                },
                {
                  "type": "field",
                  "key": "rationale",
                  "dataType": "Text",
                  "label": "Grant Rationale"
                },
                {
                  "type": "field",
                  "key": "grant_due_date",
                  "dataType": "Date",
                  "label": "Grant Report Due Date"
                },
                {
                  "type": "field",
                  "key": "grant_report_received",
                  "dataType": "Boolean",
                  "label": "Grant Report Received"
                },
                {
                  "type": "field",
                  "key": "status_id:label",
                  "dataType": "Integer",
                  "label": "Grant Status"
                },
                {
                  "type": "field",
                  "key": "amount_total",
                  "dataType": "Money",
                  "label": "Total Amount"
                }
              ]
            }
          }
        ],
        "match": [
          "saved_search_id",
          "name"
        ]
      }
    ]
  ]
  
  ```
  
  
  ---
  
  ### Answer by username_2 on 2020-07-02. Score: 1
  
  If the tokens for grants are not available in core (which I can imagine) and appartently the data-processor tokens extension does not work with them either, the option you have left is to create an extension that adds them as custom tokens.
  
  > **Comments:**
  > **username_3**: or add to https://github.com/eileenmcnaughton/nz.co.username_3.civitoken  
  
  ---
  
  