Possible to assign Smart Groups’ Search in field from template?

Is there any way to export (save to Templates folder) Smart Groups – as part of of project template – in such a way that one can assign Smart Groups’ Search in field to refer to the project project Group (or any other designation, apart from the default “Database” setting)?

As far as I know, template-produced Smart Groups’ Search in is set to “Database” automatically, and there’s no way to change that while assembling a template. Just wanted to be sure that’s true.

Thanks!

I’m interested in this information, too.

create record with {name:"Alle relevanten Steuerunterlagen für " & taxYear, record type:smart group, search predicates:"kind:pdf {any: tags:taxes-" & taxYear & ";steuern-" & taxYear & "}", search group:"business"} in newGroup

Or is it possible to change the database attribute later on? @BLUEFROG Can you help me/us with this?

Here is a simple example…

tell application id "DNtp"
	repeat with a in {"2024", "2025"}
		set newSmartGroup to create record with ¬
			{name:" Markdown Docs", record type:smart group, search predicates:"kind:markdown", search group:(get record at "/" & a)} ¬
				in (current group)
	end repeat
	set search group of newSmartGroup to (get record at "/2023")
end tell

Thanks! I was not aware, that smart groups in databases are database local, but that makes sense. :slight_smile:

You’re welcome.
And yes, there are two types of smart groups: local and global. Local ones logically only target locations in the current database. Global ones target all open databases though they also can target specific locations in a database as well. There’s not much point to such a global smart group given you can add local ones as Favorites.