# Two small problems caused by splitting the database

**URL:** <https://discourse.devontechnologies.com/t/two-small-problems-caused-by-splitting-the-database/58848>\
**Category:** DEVONthink\
**Tags:** feature-request\
**Created:** [October 13, 2020, 10:02am UTC](https://discourse.devontechnologies.com/t/two-small-problems-caused-by-splitting-the-database/58848 "2020-10-13T10:02:54Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [October 13, 2020, 1:24pm UTC](https://discourse.devontechnologies.com/t/two-small-problems-caused-by-splitting-the-database/58848/5 "2020-10-13T13:24:16Z")

</div>

Take a look at [Script: Create or change smart group(s)](https://discourse.devontechnologies.com/t/script-create-or-change-smart-group-s/56556)

Especially this part (checking if a record at a location exists) could be useful:

> [@Script: Create or change smart group(s)](https://discourse.devontechnologies.com/t/script-create-or-change-smart-group-s/56556/1):
>
> ```auto
> if not (exists record at ("/" & theMetaGroupName & "/" & theSmartGroupName) in theDatabase) then
> set theSubsetsSmartGroup to create record with {type:smart group, search predicates:"kind:smart group", search group:theDatabase, name:theSmartGroupName, exclude from search:true} in theMetaGroup
> else
> set theSubsetsSmartGroup to get record at ("/" & theMetaGroupName & "/" & theSmartGroupName) in theDatabase
> end if
> 
> ```

You’ll have to study the script on your own 🙂

---

_[View the full topic](https://discourse.devontechnologies.com/t/two-small-problems-caused-by-splitting-the-database/58848)._
