Answers.Body: <p>To pre-select multiple select value fields you can provide values with <code>,</code> separated. </p>
  
  <p>Example:</p>
  
  <pre><code>.../index.php?option=com_civicrm&amp;task=civicrm/profile&amp;Itemid=145&amp;_qf_Search_display=true&amp;custom_2=2,1
  </code></pre>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-05T15:43:22.360Z
Answers.Text: I can see the options with values 2 and 1 pre-preselected in the search form and it's not returning anything. Error" no matches found for ...
Answers.UserDisplayName: user1314302
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-06T03:11:46.547Z
Answers.Text: can you provide an example from demo site so this can be assessed by seeing a real example?
Answers.UserDisplayName: petednz - fuzion
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-06T04:09:12.280Z
Answers.Text: Yes, i could replicate on my 4.7.31 instance. The fields gets prepopulated but the force=1 doesn't respect
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-05T05:41:17.423Z
Answers.LastActivityDate: 2018-02-05T05:41:17.423Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>I would like to create a link to a pre-filtered profile search.
  I have a field (custom_2) with multiple values.
  I was able to link using one value (ex id=2) suing this url:
  .../index.php?option=com_civicrm&amp;task=civicrm/profile&amp;Itemid=45&amp;_qf_Search_display=true&amp;custom_2=2</p>
  
  <p>However when I try the following I only get results of the last ID (ex. 1):
  .../index.php?option=com_civicrm&amp;task=civicrm/profile&amp;Itemid=145&amp;_qf_Search_display=true&amp;custom_2=2&amp;custom_2=1</p>
  
  <p>When using the following URL, I get the results of both values (2 and 1) but I also get an error:
  .../index.php?option=com_civicrm&amp;task=civicrm/profile&amp;Itemid=145&amp;_qf_Search_display=true&amp;custom_2[]=2&amp;custom_2[]=1</p>
  
  <p>Error:
  Warning: strpos() expects parameter 1 to be string, array given in /home1/.../public_html/administrator/components/com_civicrm/civicrm/CRM/Profile/Form/Search.php on line 65</p>
  
  <p>Warning: explode() expects parameter 2 to be string, array given in /home1/.../public_html/administrator/components/com_civicrm/civicrm/CRM/Profile/Form/Search.php on line 66</p>
  
  <p>Warning: Invalid argument supplied for foreach() in /home1/.../public_html/administrator/components/com_civicrm/civicrm/CRM/Profile/Form/Search.php on line 68</p>
  
  <p>I'm not sure what to put in the URL to get rid of the error and get results from multiple value of the same field.</p>
  
  <p>This is CiviCRM 4.7.29 on Joomla 3.8.3</p>
  
Tags: <profile><search><links>
Title: How to link profile field with multiple values?
ThreadText: # How to link profile field with multiple values?
  
  (Asked by: username_0 on 2018-02-03)
  
  I would like to create a link to a pre-filtered profile search.
  I have a field (custom\_2) with multiple values.
  I was able to link using one value (ex id=2) suing this url:
  .../index.php?option=com\_civicrm&task=civicrm/profile&Itemid=45&\_qf\_Search\_display=true&custom\_2=2
  
  However when I try the following I only get results of the last ID (ex. 1):
  .../index.php?option=com\_civicrm&task=civicrm/profile&Itemid=145&\_qf\_Search\_display=true&custom\_2=2&custom\_2=1
  
  When using the following URL, I get the results of both values (2 and 1) but I also get an error:
  .../index.php?option=com\_civicrm&task=civicrm/profile&Itemid=145&\_qf\_Search\_display=true&custom\_2[]=2&custom\_2[]=1
  
  Error:
  Warning: strpos() expects parameter 1 to be string, array given in /home1/.../public\_html/administrator/components/com\_civicrm/civicrm/CRM/Profile/Form/Search.php on line 65
  
  Warning: explode() expects parameter 2 to be string, array given in /home1/.../public\_html/administrator/components/com\_civicrm/civicrm/CRM/Profile/Form/Search.php on line 66
  
  Warning: Invalid argument supplied for foreach() in /home1/.../public\_html/administrator/components/com\_civicrm/civicrm/CRM/Profile/Form/Search.php on line 68
  
  I'm not sure what to put in the URL to get rid of the error and get results from multiple value of the same field.
  
  This is CiviCRM 4.7.29 on Joomla 3.8.3
  
  **Tags:** profile, search, links
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-02-05. Score: 0
  
  To pre-select multiple select value fields you can provide values with , separated. 
  Example:
  .../index.php?option=com_civicrm&task=civicrm/profile&Itemid=145&_qf_Search_display=true&custom_2=2,1
  
  HTH
  Pradeep
  
  > **Comments:**
  > **username_0**: I can see the options with values 2 and 1 pre-preselected in the search form and it's not returning anything. Error" no matches found for ...  
  > **username_2**: can you provide an example from demo site so this can be assessed by seeing a real example?  
  > **username_1**: Yes, i could replicate on my 4.7.31 instance. The fields gets prepopulated but the force=1 doesn't respect  
  
  ---
  
  