# Can I set up searches using variable parameters?

**URL:** <https://discourse.devontechnologies.com/t/can-i-set-up-searches-using-variable-parameters/61095>\
**Category:** DEVONthink\
**Created:** [January 20, 2021, 11:17pm UTC](https://discourse.devontechnologies.com/t/can-i-set-up-searches-using-variable-parameters/61095 "2021-01-20T23:17:26Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![pete31](https://discourse.devontechnologies.com/letter_avatar_proxy/v4/letter/p/d26b3c/32.png) [@pete31](https://discourse.devontechnologies.com/u/pete31)\
**Post date:** [January 21, 2021, 4:04pm UTC](https://discourse.devontechnologies.com/t/can-i-set-up-searches-using-variable-parameters/61095/11 "2021-01-21T16:04:14Z")

</div>

> [@DrJJWMac](#):
>
> here is the database with the example of two out of two dozen or more folders that I want to build.

Thanks. Ok, I got it now that you want to create Smart Groups (I was under the impression that you wanted to write names or links of search results into a TOC, e.g. a Markdown TOC record, thus the confusion).

Take a look at [Script: Create or change smart group(s)](https://discourse.devontechnologies.com/t/script-create-or-change-smart-group-s/56556). This script asks for a query and creates a Smart Group in all selected groups. If you modify it a bit and e.g.

- store your variable in the finder comments or custom meta data of selected groups
- set the dialog’s default answer to your “default” query (the part that’s static)

then it could be possible to get quite near to what you have in mind, I think.

Personally I use a version of this script where the dialog has an extra button “Templates”. Clicking this opens a “choose from list” dialog with template queries (which are stored in a text file that can be opened from within that dialog). That could make sense for you too.

---

_[View the full topic](https://discourse.devontechnologies.com/t/can-i-set-up-searches-using-variable-parameters/61095)._
