Answers.Body: <p>If you use the <a href="https://civicrm.org/extensions/summary-fields" rel="nofollow noreferrer">Summary Fields</a> extension or possibly <a href="https://civicrm.org/extensions/synopsis" rel="nofollow noreferrer">Synopsis</a> then you should be able to set up so you have a Custom Field which contains the data of their last donation, and then use the token for that Custom Field to get the outcome you want.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-19T21:45:04.983Z
Answers.LastActivityDate: 2023-05-19T21:45:04.983Z
Answers.UserDisplayName: petednz - fuzion
Answers.Body: <p>You could get something close with SearchKit, but not quite what you are looking for. With the search below, you'll get Contacts with their most recent donation date and their total donations over whatever period you are interested in (you could also add the count of donations over that period too). I can't see a way to only show the amount of the most recent contribution in SearchKit, but maybe someone else can.</p>
  <p>You can find:</p>
  <ul>
  <li>Contacts</li>
  <li>with (optional) Contact Contributions with Status = Completed and Financial Type and Date Received as needed</li>
  <li>Group by Contact ID so you have one row per contact</li>
  <li>Add the Date Received and Total Amount columns on the top right of
  the table.</li>
  <li>Under Field Transformations, select Max for Date Received (so you are
  showing the largest date, i.e. the most recent donation date) and
  select Sum for Total Amount (so you'll have the sum of all donations
  in the time period).</li>
  <li>If you want a count of donations too, add the Contribution ID column and then select Count under Field Transformations.</li>
  </ul>
  <p>The date might not come through in a spreadsheet-usable format (though that has just been fixed so won't be a problem in the future). If you need that sorted out, you can do it by adding a table and adjusting the date format with a rewrite.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-23T21:01:40.643Z
Answers.Text: In the near future (July 2023?) you will be able to create a SK search that provides the most recent contribution date per contact ID, with a display of type "entity". Then you can create a second SK search with a join to this entity. That should get you to the finish line. See https://github.com/civicrm/civicrm-core/pull/25871. In the meantime, @petendz-fuzion's solution is probably the best fit.
Answers.UserDisplayName: Noah Miller
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-05-19T04:03:53.757Z
Answers.LastActivityDate: 2023-05-19T04:03:53.757Z
Answers.UserDisplayName: Lars SG
Body: <p>I need to export a list of our contacts which is easy enough. However, I cannot figure out how to include in that export if they are a donor - and ideally the date/amount of their last donation. When building the fields to export I don’t see any option for this so I’m running two reports - a contact export and a donor export and merge them in excel and then spend time sorting them all out. What am I missing? Surely there is a way to export all contacts with donation information for those who have donated. Thanks in advance!</p>
  
Tags: <contacts><export>
Title: Export contacts with last donation date/amount (if there is a donation)
ThreadText: # Export contacts with last donation date/amount (if there is a donation)
  
  (Asked by: username_0 on 2023-05-18)
  
  I need to export a list of our contacts which is easy enough. However, I cannot figure out how to include in that export if they are a donor - and ideally the date/amount of their last donation. When building the fields to export I don’t see any option for this so I’m running two reports - a contact export and a donor export and merge them in excel and then spend time sorting them all out. What am I missing? Surely there is a way to export all contacts with donation information for those who have donated. Thanks in advance!
  
  **Tags:** contacts, export
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-05-19. Score: 2
  
  If you use the [Summary Fields](https://civicrm.org/extensions/summary-fields) extension or possibly [Synopsis](https://civicrm.org/extensions/synopsis) then you should be able to set up so you have a Custom Field which contains the data of their last donation, and then use the token for that Custom Field to get the outcome you want.
  
  
  ---
  
  ### Answer by username_2 on 2023-05-19. Score: 2
  
  You could get something close with SearchKit, but not quite what you are looking for. With the search below, you'll get Contacts with their most recent donation date and their total donations over whatever period you are interested in (you could also add the count of donations over that period too). I can't see a way to only show the amount of the most recent contribution in SearchKit, but maybe someone else can.
  
  You can find:
  
  * Contacts
  * with (optional) Contact Contributions with Status = Completed and Financial Type and Date Received as needed
  * Group by Contact ID so you have one row per contact
  * Add the Date Received and Total Amount columns on the top right of
    the table.
  * Under Field Transformations, select Max for Date Received (so you are
    showing the largest date, i.e. the most recent donation date) and
    select Sum for Total Amount (so you'll have the sum of all donations
    in the time period).
  * If you want a count of donations too, add the Contribution ID column and then select Count under Field Transformations.
  
  The date might not come through in a spreadsheet-usable format (though that has just been fixed so won't be a problem in the future). If you need that sorted out, you can do it by adding a table and adjusting the date format with a rewrite.
  
  > **Comments:**
  > **username_3**: In the near future (July 2023?) you will be able to create a SK search that provides the most recent contribution date per contact ID, with a display of type "entity". Then you can create a second SK search with a join to this entity. That should get you to the finish line. See https://github.com/civicrm/civicrm-core/pull/25871. In the meantime, @petendz-username_1's solution is probably the best fit.  
  
  ---
  
  