Answers.Body: <p>Api result doesn't return if the fields value is NULL. In your case result field must be <strong>NULL</strong> for the activity you trying to get. Try using to check if the result key is present in api result and use accordingly.</p>
  
  <p>$result = CRM_Utils_Array::value('result', $activityResults);
  or !empty($activityResults['result'])</p>
  
  <p><a href="https://i.sstatic.net/FvDrv.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FvDrv.png" alt="enter image description here"></a></p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-21T08:44:11.287Z
Answers.LastActivityDate: 2018-07-21T08:44:11.287Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>The default field on the Activity API doesn't return 'result' field by default, or even when specified as a return value. I've never added one of these before, if someone could let me know how it's done I'll sort a PR out. Thanks!</p>
  
  <p>If anyone's interested - the use case is deleting Twilio's copy of messages after a period on a scheduled job. The return value is Twilio's SMS Unique ID.</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-21T00:20:17.810Z
Comments.Text: I think there is some weird logic that blocks it somewhere in the code for reasons unclear
Comments.UserDisplayName: user4278
Tags: <api>
Title: Activity 'Result' field missing from API
ThreadText: # Activity 'Result' field missing from API
  
  (Asked by: username_0 on 2018-07-21)
  
  The default field on the Activity API doesn't return 'result' field by default, or even when specified as a return value. I've never added one of these before, if someone could let me know how it's done I'll sort a PR out. Thanks!
  
  If anyone's interested - the use case is deleting Twilio's copy of messages after a period on a scheduled job. The return value is Twilio's SMS Unique ID.
  
  **Tags:** api
  
  > **Comments:**
  > **username_1**: I think there is some weird logic that blocks it somewhere in the code for reasons unclear  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2018-07-21. Score: 1
  
  Api result doesn't return if the fields value is NULL. In your case result field must be **NULL** for the activity you trying to get. Try using to check if the result key is present in api result and use accordingly.
  
  $result = CRM\_Utils\_Array::value('result', $activityResults);
  or !empty($activityResults['result'])
  
  [![enter image description here](https://i.sstatic.net/FvDrv.png)](https://i.sstatic.net/FvDrv.png)
  
  HTH
  
  Pradeep
  
  
  ---
  
  