Answers.Body: <p>You can use <a href="https://docs.civicrm.org/user/en/latest/searching/searchkit/what-is-searchkit/" rel="nofollow noreferrer">search-kit</a> and do various conditioning your self.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-18T12:36:57.397Z
Answers.LastActivityDate: 2024-04-18T12:36:57.397Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I have got a multi-select autocomplete-select custom field that I am trying to use with advanced search. It works however I would like to optimize/make some adjustments to fit my needs better:</p>
  <ul>
  <li><p>is there a way to modify to query builder to select records that not only equal to but also begin with my custom field values (in sql terms from <code>... field = 'value' ...</code> to <code>... field like 'value%' ...</code>).
  I have noticed that multiple values are separated by ascii 1 char in the database but have not found a query that does the split at the database level. Is my observation right? Am I safe to assume this happens at the application level? Is there a way to override this code at the extension level?</p>
  </li>
  <li><p>when I specify more than one value I see that the query uses AND operator - how do I go about changing it to OR</p>
  </li>
  </ul>
  
Tags: <custom-fields><advanced-search>
Title: Modifying advanced search query based on custom fields
ThreadText: # Modifying advanced search query based on custom fields
  
  (Asked by: username_0 on 2024-04-18)
  
  I have got a multi-select autocomplete-select custom field that I am trying to use with advanced search. It works however I would like to optimize/make some adjustments to fit my needs better:
  
  * is there a way to modify to query builder to select records that not only equal to but also begin with my custom field values (in sql terms from `... field = 'value' ...` to `... field like 'value%' ...`).
    I have noticed that multiple values are separated by ascii 1 char in the database but have not found a query that does the split at the database level. Is my observation right? Am I safe to assume this happens at the application level? Is there a way to override this code at the extension level?
  * when I specify more than one value I see that the query uses AND operator - how do I go about changing it to OR
  
  **Tags:** custom-fields, advanced-search
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-18. Score: 0
  
  You can use [search-kit](https://docs.civicrm.org/user/en/latest/searching/searchkit/what-is-searchkit/) and do various conditioning your self.
  
  
  ---
  
  