1

I want to search for people who have an activity created by a specific person. Search Builder lists the 'Source Contact ID' field but doesn't populate the information nor filter things appropriately. Advanced Search produces similar results. Is there a way to find this group of contacts based on activity and who created the activity?

2 Answers 2

2

Search Builder seems to be broken for this functionality, you may report that as an issue in the issue tracker: https://issues.civicrm.org/.

My understanding is that you want to search within the backend of CiviCRM? Using the API is currently probably the cleanest way of performing the search and adding them at once by using the Activity.get and chaining it with GroupContact.create:

cv api Activity.get sequential=1 return="target_contact_id" source_contact_id=11 target_contact_id={"IS NOT NULL":1} options={"limit":0} api.GroupContact.create={"group_id":"5","contact_id":"$value.target_contact_id"}

Alternatively you can use the advanced search and search for all activities that have your desired contact as "Added by" and display results as Activity. You can then tag all those activities with a temporary tag that can be used for activities. In a second advanced search you can search for contacts that have an activity "With" and the temporary tag and add those contacts to a group.

There is also the activity detail report that will let you filter those contacts the easiest way, but I cant see how to get those contacts into a group.

1
  • Thank you for the API code. That may be a good solution going forward after I increase my understanding of APIs. I'm hoping to use the native functionality of Civi because I do want to put those contacts in a smart group. I just tried tagging the activities but that seems to put me in a similar place where a search won't be automatically updated.
    – J. Rolfs
    Aug 4, 2017 at 15:28
0

For Drupal users you can build a View that will deliver that information but won't then provide the Actions options available through Search in CiviCRM (though some actions via VBO are possible)

Without knowing the OP's CMS this answer may not be helpful to them but may be an answer for others looking at this issue who are using Drupal

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.