Body: <p>I got a custom search which takes one parameter, group.  This search gives us back the people in the group plus a custom status.  I'd like to be able to add a number of menu items that would run the search for various specific groups.</p>
  
  <p>I'd also like to have an automatic email go out, say every month, to certain people with the results.</p>
  
  <p>I thought maybe saving the query results as a smart group might work but alas trying to create a smart group bombs.</p>
  
  <p>So is it possible to just pass the parameter through the url or are there other solutions?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-07T04:00:20.920Z
Comments.Text: have you seen my answer at https://civicrm.stackexchange.com/questions/25787/how-can-i-generate-a-search-results-page-from-a-list-of-contact-ids-programatic/25803#25803
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-07T04:00:36.113Z
Comments.Text: also can you clarify what you mean by 'smart group bombs'
Comments.UserDisplayName: petednz - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-07T17:29:36.523Z
Comments.Text: I have now looked at your answer.  Sadly I need group_id, so that won't work in the case but I like it and will probably use it in other cases
Comments.UserDisplayName: Paul-Tahoe
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-10-07T17:42:59.007Z
Comments.Text: By bombs, fatal error,  In this case, badly formed sql.  It appended a WHERE ( 1 )  AND contact_a.id NOT IN ( SELECT contact_id FROM civicrm_group_contact... to the end of the query.  Should have been an AND.  I'm guessing it did that because I shortcut the custom query sticking all the sql in one place and not dividing it up into select, from, where, having, etc.  It did actually create the smart group and it works mostly.  I'll have to spend the time to divide up the sql and see if that fixes that, sigh. I feel creating a simple custom query should be easier.  The sql is easy, all the php...
Comments.UserDisplayName: Paul-Tahoe
Tags: <custom-search>
Title: Can I pass parameters in the url to a custom search?
ThreadText: # Can I pass parameters in the url to a custom search?
  
  (Asked by: username_0 on 2018-10-06)
  
  I got a custom search which takes one parameter, group. This search gives us back the people in the group plus a custom status. I'd like to be able to add a number of menu items that would run the search for various specific groups.
  
  I'd also like to have an automatic email go out, say every month, to certain people with the results.
  
  I thought maybe saving the query results as a smart group might work but alas trying to create a smart group bombs.
  
  So is it possible to just pass the parameter through the url or are there other solutions?
  
  **Tags:** custom-search
  
  > **Comments:**
  > **username_1**: have you seen my answer at https://civicrm.stackexchange.com/questions/25787/how-can-i-generate-a-search-results-page-from-a-list-of-contact-ids-programatic/25803#25803  
  > **username_1**: also can you clarify what you mean by 'smart group bombs'  
  > **username_0**: I have now looked at your answer.  Sadly I need group_id, so that won't work in the case but I like it and will probably use it in other cases  
  > **username_0**: By bombs, fatal error,  In this case, badly formed sql.  It appended a WHERE ( 1 )  AND contact_a.id NOT IN ( SELECT contact_id FROM civicrm_group_contact... to the end of the query.  Should have been an AND.  I'm guessing it did that because I shortcut the custom query sticking all the sql in one place and not dividing it up into select, from, where, having, etc.  It did actually create the smart group and it works mostly.  I'll have to spend the time to divide up the sql and see if that fixes that, sigh. I feel creating a simple custom query should be easier.  The sql is easy, all the php...  
  
  ---
  
  ## 0 answers
  
  