Answers.Body: <p>This is almost certainly a bug, but unlikely to be fixed in v3.</p>
  
  <p>As Aidan mentioned - there are non-standard APIs in v3, and the Participant API is one of them, along with Contact and EntityTag.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-05T18:39:52.803Z
Answers.LastActivityDate: 2019-02-05T18:39:52.803Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>When I do this:</p>
  
  <pre><code>$result = civicrm_api3('Participant', 'get', [
    'sequential' =&gt; 1,
    'return' =&gt; ["custom_14"],
    'event_id' =&gt; 3,
  ]);
  </code></pre>
  
  <p>In the results I get the desired custom field, but I also get all the other custom fields. At first I thought it's just the entire custom field set but then I tested it and it returns all the custom fields for participants no matter which field set they belong to. </p>
  
  <pre><code> "is_error": 0,
      "version": 3,
      "count": 18,
      "values": [
          {
              "contact_id": "181",
              "participant_id": "46",
              "civicrm_value_ew_9_id": "1",
              "custom_14": "dsfa",
              "custom_14_1": "dsfa",
              "custom_15": "d",
              "custom_15_1": "d",
              "custom_16": "AAA",
              "custom_16_1": "AAA",
              "id": "46"
          },
  </code></pre>
  
  <p>The value I looked for is returned with civicrm_value prefix, but why is the other data displayed as well? Is this a bug or am I missing something?
  This seems to be the case for the Participant entity only.</p>
  
  <p>I tested this on CiviCRM 5.9.1 and Michael McAndrew docker image with CiviCRM 5.11.alpha1.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-02-05T15:07:43.387Z
Comments.Text: Doesn't answer your question specifically, but there are inconsistencies in APIv3 and APIv4 aims to improve that.
Comments.UserDisplayName: Aidan
Tags: <custom-fields><api>
Title: Why does API get participants return all custom fields together with the specified return field?
ThreadText: # Why does API get participants return all custom fields together with the specified return field?
  
  (Asked by: username_0 on 2019-02-05)
  
  When I do this:
  
  ```
  $result = civicrm_api3('Participant', 'get', [
    'sequential' => 1,
    'return' => ["custom_14"],
    'event_id' => 3,
  ]);
  
  ```
  
  In the results I get the desired custom field, but I also get all the other custom fields. At first I thought it's just the entire custom field set but then I tested it and it returns all the custom fields for participants no matter which field set they belong to.
  
  ```
   "is_error": 0,
      "version": 3,
      "count": 18,
      "values": [
          {
              "contact_id": "181",
              "participant_id": "46",
              "civicrm_value_ew_9_id": "1",
              "custom_14": "dsfa",
              "custom_14_1": "dsfa",
              "custom_15": "d",
              "custom_15_1": "d",
              "custom_16": "AAA",
              "custom_16_1": "AAA",
              "id": "46"
          },
  
  ```
  
  The value I looked for is returned with civicrm\_value prefix, but why is the other data displayed as well? Is this a bug or am I missing something?
  This seems to be the case for the Participant entity only.
  
  I tested this on CiviCRM 5.9.1 and Michael McAndrew docker image with CiviCRM 5.11.alpha1.
  
  **Tags:** custom-fields, api
  
  > **Comments:**
  > **username_1**: Doesn't answer your question specifically, but there are inconsistencies in APIv3 and APIv4 aims to improve that.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2019-02-05. Score: 1
  
  This is almost certainly a bug, but unlikely to be fixed in v3.
  
  As username_1 mentioned - there are non-standard APIs in v3, and the Participant API is one of them, along with Contact and EntityTag.
  
  
  ---
  
  