We are building a search form using a search kit. Based on saved search name

          "return": "page:1",
          "savedSearch": "Member_Player_Search",
          "display": "Table",
          "sort": [
          "limit": 50,
          "seed": 1682511192645,
          "filters": {
            "last_name": "test",
            "first_name": "user"
          "afform": "afsearchPlayerSearch"

Example :

if (!empty($filter['last_name'])) {
  $filter['custom_123'] = 1;
// custom_123 is boolean field of Yes/No.

If the last name is not empty in the filter then I want to add an additional filter before making a call to contact api. (through hook)

Is this feasible ?

I tried using the search kit tool fx if/else functionality but was not able to figure it out in the UI to make the same condition.

Drupal 9, CiviCRM 5.57

1 Answer 1


I think the apiWrapper hook can do this (it's deprecated, but scroll down to see how to implement it the new way)

Your Answer

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

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