Answers.Body: <p>A work-around for this is:</p>
  <ol>
  <li>From the search results, create a new group.</li>
  <li>Go to <strong>Contacts » Manage Groups</strong> find your new group and click <strong>Contacts</strong></li>
  <li>Choose <strong>Export Fields</strong></li>
  </ol>
  <p>It <em>is</em> an annoying bug, but obviously it's a bit akward for some reason.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-15T08:45:24.267Z
Answers.LastActivityDate: 2021-06-15T08:45:24.267Z
Answers.UserDisplayName: artfulrobot
Answers.Body: <p>Martin - one of our team had a quick dig. He says there is code that is intentionally preventing this, presumably as there is no presumption on what entity (member/contact/activity) is involved in the search.</p>
  <p>Code involved can be seen at <a href="https://github.com/civicrm/civicrm-core/pull/11458/files" rel="nofollow noreferrer">https://github.com/civicrm/civicrm-core/pull/11458/files</a></p>
  <p>If that is enough for you to make a custom change (hack) to your system to get you over the hurdle, then good luck (normal warnings apply ie backup, etc)</p>
  <p>If you would like us to work with you to sort this out either just for your situation, or a more generic fix that could end up as a community contribution (change to core, extension etc) then pls get in touch.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-13T15:12:23.200Z
Answers.Text: Thanks, Pete. Patching the code led to follow-up problems, namely all contacts instead of the search result being exported. I guess we will file an issue and try to contact core team next.
Answers.UserDisplayName: Martin Peth
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-13T20:52:43.240Z
Answers.Text: Okay. You are welcome to approach Partners such as Fuzion (us) to get these fixes done too.
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-14T07:06:33.997Z
Answers.Text: I'm not sure if it's really just a fix. In the meantime, I found this here in the issue tracker where the core team rated it as a feature in its own right: https://issues.civicrm.org/jira/browse/CRM-8140 Makes me think it might be not that simple. We'll await the core team's estimate. Thanks again, Pete!
Answers.UserDisplayName: Martin Peth
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-06-15T08:42:17.107Z
Answers.Text: This was "fixed" in 4.7.31 by [PR 11458](https://github.com/civicrm/civicrm-core/pull/11458) but then found not fixed and quite problematic, so [unfixed(!) again in 5.0](https://github.com/civicrm/civicrm-core/pull/11828). It remains a problem in 5.35.
Answers.UserDisplayName: artfulrobot
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2017-06-09T21:14:19.810Z
Answers.LastActivityDate: 2021-06-15T08:43:29.883Z
Answers.LastEditDate: 2021-06-15T08:43:29.883Z
Answers.UserDisplayName: petednz - fuzion
Body: <p>When using custom searches such as the Include/Exclude search, the resulting contacts can be exported, but there's no option given to select the fields. Fields to be included in the export file are apparently predefined in the search. That might make sense in some cases, but we have a scenario where the export file is pretty useless. Working around this with a temporary group or tag is a hassle.</p>
  
  <p>Why is it that field mappings are not provided here? And can anybody assess what it might take to alter that behaviour in core, or which follow-up problems that would possibly implicate?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-08T19:52:40.483Z
Comments.Text: Yep, this has tripped us up a couple of times. I am asking on of our team to do a quick estimate on this to get a sense of what is required in case you might be able to help fund it.
Comments.UserDisplayName: petednz - fuzion
Tags: <export><custom-search>
Title: Why are export field mappings not available for custom search results?
ThreadText: # Why are export field mappings not available for custom search results?
  
  (Asked by: username_0 on 2017-06-08)
  
  When using custom searches such as the Include/Exclude search, the resulting contacts can be exported, but there's no option given to select the fields. Fields to be included in the export file are apparently predefined in the search. That might make sense in some cases, but we have a scenario where the export file is pretty useless. Working around this with a temporary group or tag is a hassle.
  
  Why is it that field mappings are not provided here? And can anybody assess what it might take to alter that behaviour in core, or which follow-up problems that would possibly implicate?
  
  **Tags:** export, custom-search
  
  > **Comments:**
  > **username_1**: Yep, this has tripped us up a couple of times. I am asking on of our team to do a quick estimate on this to get a sense of what is required in case you might be able to help fund it.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-06-15. Score: 2
  
  A work-around for this is:
  
  1. From the search results, create a new group.
  2. Go to **Contacts » Manage Groups** find your new group and click **Contacts**
  3. Choose **Export Fields**
  
  It *is* an annoying bug, but obviously it's a bit akward for some reason.
  
  
  ---
  
  ### Answer by username_1 on 2017-06-09. Score: 1
  
  username_0 - one of our team had a quick dig. He says there is code that is intentionally preventing this, presumably as there is no presumption on what entity (member/contact/activity) is involved in the search.
  
  Code involved can be seen at <https://github.com/civicrm/civicrm-core/pull/11458/files>
  
  If that is enough for you to make a custom change (hack) to your system to get you over the hurdle, then good luck (normal warnings apply ie backup, etc)
  
  If you would like us to work with you to sort this out either just for your situation, or a more generic fix that could end up as a community contribution (change to core, extension etc) then pls get in touch.
  
  > **Comments:**
  > **username_0**: Thanks, Pete. Patching the code led to follow-up problems, namely all contacts instead of the search result being exported. I guess we will file an issue and try to contact core team next.  
  > **username_1**: Okay. You are welcome to approach Partners such as username_1 (us) to get these fixes done too.  
  > **username_0**: I'm not sure if it's really just a fix. In the meantime, I found this here in the issue tracker where the core team rated it as a feature in its own right: https://issues.civicrm.org/jira/browse/CRM-8140 Makes me think it might be not that simple. We'll await the core team's estimate. Thanks again, Pete!  
  > **username_2**: This was "fixed" in 4.7.31 by [PR 11458](https://github.com/civicrm/civicrm-core/pull/11458) but then found not fixed and quite problematic, so [unfixed(!) again in 5.0](https://github.com/civicrm/civicrm-core/pull/11828). It remains a problem in 5.35.  
  
  ---
  
  