Answers.Body: <p>This is straightforward with Search Kit.  Below is a search you can import into Search Kit.  I've only added Contribution ID and Membership ID to the columns, but you can add whatever other fields you like.</p>
  <p>I'm also adding a screenshot in case your CiviCRM version isn't new enough to support Search Kit imports:</p>
  <p><a href="https://i.sstatic.net/NYBaU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/NYBaU.png" alt="enter image description here" /></a></p>
  <pre><code>[
    [
      &quot;SavedSearch&quot;,
      &quot;save&quot;,
      {
        &quot;records&quot;: [
          {
            &quot;name&quot;: &quot;Contributions_with_Memberships&quot;,
            &quot;label&quot;: &quot;Contributions with Memberships&quot;,
            &quot;form_values&quot;: null,
            &quot;search_custom_id&quot;: null,
            &quot;api_entity&quot;: &quot;Contribution&quot;,
            &quot;api_params&quot;: {
              &quot;version&quot;: 4,
              &quot;select&quot;: [
                &quot;id&quot;,
                &quot;Contribution_LineItem_contribution_id_01_LineItem_Membership_entity_id_01.id&quot;
              ],
              &quot;orderBy&quot;: [],
              &quot;where&quot;: [],
              &quot;groupBy&quot;: [],
              &quot;join&quot;: [
                [
                  &quot;LineItem AS Contribution_LineItem_contribution_id_01&quot;,
                  &quot;INNER&quot;,
                  [
                    &quot;id&quot;,
                    &quot;=&quot;,
                    &quot;Contribution_LineItem_contribution_id_01.contribution_id&quot;
                  ]
                ],
                [
                  &quot;Membership AS Contribution_LineItem_contribution_id_01_LineItem_Membership_entity_id_01&quot;,
                  &quot;INNER&quot;,
                  [
                    &quot;Contribution_LineItem_contribution_id_01.entity_id&quot;,
                    &quot;=&quot;,
                    &quot;Contribution_LineItem_contribution_id_01_LineItem_Membership_entity_id_01.id&quot;
                  ],
                  [
                    &quot;Contribution_LineItem_contribution_id_01.entity_table&quot;,
                    &quot;=&quot;,
                    &quot;'civicrm_membership'&quot;
                  ]
                ]
              ],
              &quot;having&quot;: []
            },
            &quot;expires_date&quot;: null,
            &quot;description&quot;: null,
            &quot;mapping_id&quot;: null
          }
        ],
        &quot;match&quot;: [
          &quot;name&quot;
        ]
      }
    ]
  ]
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-19T02:02:44.570Z
Answers.LastActivityDate: 2022-04-19T02:02:44.570Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Answers.Body: <p>Depending on exactly what you want, you may be able to use the Contributions and Membership report, filtering on Finance type for membership and then exporting as CSV. But you'd need to do a bit of work in it as the contact info isn't shown on every line.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-07-22T22:24:25.357Z
Answers.LastActivityDate: 2021-07-22T22:24:25.357Z
Answers.UserDisplayName: Mick Kahn
Body: <p>I am attempting to export Memberships and Contributions. When I export Memberships, there is no field to export associated Contribution records/IDs. When I export Contributions, there is not field to export the associated Membership (if it was a membership).</p>
  <p>Currently, the only unique ID on the Contributions is the Contact ID - but a Contact can have multiple contributions (i.e. membership purchase, renewal, event sign up, etc.)</p>
  <p>How can I export the related/associated Membership ID for a Contribution?</p>
  <p>Alternatively, I thought it could work to export the Memberships if they included the Contribution amount. But that is also not an option on the Membership export, only Recurring Contribution ID.</p>
  
Tags: <civimember><contributions><export>
Title: Export Contributions with Membership ID
ThreadText: # Export Contributions with Membership ID
  
  (Asked by: username_0 on 2021-07-22)
  
  I am attempting to export Memberships and Contributions. When I export Memberships, there is no field to export associated Contribution records/IDs. When I export Contributions, there is not field to export the associated Membership (if it was a membership).
  
  Currently, the only unique ID on the Contributions is the Contact ID - but a Contact can have multiple contributions (i.e. membership purchase, renewal, event sign up, etc.)
  
  How can I export the related/associated Membership ID for a Contribution?
  
  Alternatively, I thought it could work to export the Memberships if they included the Contribution amount. But that is also not an option on the Membership export, only Recurring Contribution ID.
  
  **Tags:** civimember, contributions, export
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2022-04-19. Score: 1
  
  This is straightforward with Search Kit.  Below is a search you can import into Search Kit.  I've only added Contribution ID and Membership ID to the columns, but you can add whatever other fields you like.
  I'm also adding a screenshot in case your CiviCRM version isn't new enough to support Search Kit imports:
  
  [
    [
      "SavedSearch",
      "save",
      {
        "records": [
          {
            "name": "Contributions_with_Memberships",
            "label": "Contributions with Memberships",
            "form_values": null,
            "search_custom_id": null,
            "api_entity": "Contribution",
            "api_params": {
              "version": 4,
              "select": [
                "id",
                "Contribution_LineItem_contribution_id_01_LineItem_Membership_entity_id_01.id"
              ],
              "orderBy": [],
              "where": [],
              "groupBy": [],
              "join": [
                [
                  "LineItem AS Contribution_LineItem_contribution_id_01",
                  "INNER",
                  [
                    "id",
                    "=",
                    "Contribution_LineItem_contribution_id_01.contribution_id"
                  ]
                ],
                [
                  "Membership AS Contribution_LineItem_contribution_id_01_LineItem_Membership_entity_id_01",
                  "INNER",
                  [
                    "Contribution_LineItem_contribution_id_01.entity_id",
                    "=",
                    "Contribution_LineItem_contribution_id_01_LineItem_Membership_entity_id_01.id"
                  ],
                  [
                    "Contribution_LineItem_contribution_id_01.entity_table",
                    "=",
                    "'civicrm_membership'"
                  ]
                ]
              ],
              "having": []
            },
            "expires_date": null,
            "description": null,
            "mapping_id": null
          }
        ],
        "match": [
          "name"
        ]
      }
    ]
  ]
  
  
  ---
  
  ### Answer by username_2 on 2021-07-22. Score: 0
  
  Depending on exactly what you want, you may be able to use the Contributions and Membership report, filtering on Finance type for membership and then exporting as CSV. But you'd need to do a bit of work in it as the contact info isn't shown on every line.
  
  
  ---
  
  