Answers.Body: <p>You can retrieve contribution notes via the api using:</p>
  
  <pre><code>civicrm_api3('Note', 'get', array(
    'entity_table' =&gt; 'civicrm_contribution',
    'entity_id' =&gt; $contributionID,
  ));
  </code></pre>
  
  <p>Or see the api explorer to generate this in other formats (you can also do it from within a smarty template, for example).</p>
  
  <p><strong>Important:</strong> The api returns raw, unsanitized user input. If you are displaying this value, be sure to <em>sanitize the output</em> using <code>htmlspecialchars</code> or similar.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-10T18:08:59.087Z
Answers.LastActivityDate: 2015-04-10T18:08:59.087Z
Answers.UserDisplayName: Coleman
Answers.Body: <p>civicrm_note</p>
  
  <p>entity_table = 'civicrm_contribution'</p>
  
  <p>entity_id = contributionID</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-10T15:21:48.477Z
Answers.LastActivityDate: 2015-04-10T15:21:48.477Z
Answers.UserDisplayName: Donald Lobo
Body: <p>One can enter notes with a new contribution and they show up like this:</p>
  
  <blockquote>
    <p><strong>Campaign</strong>   Middleport Pottery, Steam Engine</p>
    
    <p><strong>Receipt Sent</strong>   April 10th, 2015 10:56 AM</p>
    
    <p><strong>Note</strong>   <strong><em>Where is the note field?</em></strong></p>
    
    <p><strong>Transaction ID</strong> 101010</p>
  </blockquote>
  
  <p>And are in the template like this:</p>
  
  <pre><code>{if $receipt_date}          
    &lt;tr&gt;          
              &lt;td class="label"&gt;{ts}Receipt Sent{/ts}&lt;/td&gt;
              &lt;td&gt;{$receipt_date|crmDate}&lt;/td&gt;
      &lt;/tr&gt;          
    {/if}
  
  {foreach from=$note item="rec"}          
    {if $rec }          
      &lt;tr&gt;          
        &lt;td class="label"&gt;{ts}Note{/ts}&lt;/td&gt;       
        &lt;td&gt;{$rec}&lt;/td&gt;             //LINE IN QUESTION!
      &lt;/tr&gt;          
    {/if}          
  {/foreach}
  
  
    {if $trxn_id}          
      &lt;tr&gt;          
        &lt;td class="label"&gt;{ts}Transaction ID{/ts}&lt;/td&gt;          
        &lt;td&gt;{$trxn_id}&lt;/td&gt;          
      &lt;/tr&gt;          
    {/if}
  </code></pre>
  
  <p>However it seems I can not export the data in this field from the user interface and I can not seem to find it in the database to create a query. Any idea on table and field?</p>
  
  <p>Thank you!</p>
  
Tags: <civicontribute><contributions><database>
Title: Where in the database is the note field for contributions?
ThreadText: # Where in the database is the note field for contributions?
  
  (Asked by: username_0 on 2015-04-10)
  
  One can enter notes with a new contribution and they show up like this:
  
  Campaign   Middleport Pottery, Steam Engine
  Receipt Sent   April 10th, 2015 10:56 AM
  Note Where is the note field?
  Transaction ID 101010
  
  And are in the template like this:
  {if $receipt_date}          
              
              {ts}Receipt Sent{/ts}
              {$receipt_date|crmDate}
                
    {/if}
  
  {foreach from=$note item="rec"}          
    {if $rec }          
                
        {ts}Note{/ts}       
        {$rec}             //LINE IN QUESTION!
                
    {/if}          
  {/foreach}
  
  
    {if $trxn_id}          
                
        {ts}Transaction ID{/ts}          
        {$trxn_id}          
                
    {/if}
  
  However it seems I can not export the data in this field from the user interface and I can not seem to find it in the database to create a query. Any idea on table and field?
  Thank you!
  
  **Tags:** civicontribute, contributions, database
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2015-04-10. Score: 6 | Accepted answer
  
  civicrm\_note
  
  entity\_table = 'civicrm\_contribution'
  
  entity\_id = contributionID
  
  
  ---
  
  ### Answer by username_1 on 2015-04-10. Score: 6
  
  You can retrieve contribution notes via the api using:
  civicrm_api3('Note', 'get', array(
    'entity_table' => 'civicrm_contribution',
    'entity_id' => $contributionID,
  ));
  
  Or see the api explorer to generate this in other formats (you can also do it from within a smarty template, for example).
  Important: The api returns raw, unsanitized user input. If you are displaying this value, be sure to sanitize the output using htmlspecialchars or similar.
  
  
  ---
  
  