You are viewing limited content. For full access, please sign in.

Question

Question

How to create Advanced Search Syntax for Finding Entries with Templates that start with same characters?

asked on October 28, 2021

This is for a workflow that uses a "Search Repository" activity.

I am trying to create some advanced search syntax using the web client repository's advanced search feature.

The targets are any entries in the selected folder who's template starts with "HR-". So basically "HR-*"

Reason being there are dozens of HR related templates and all those template names begin with those same three characters.

I cannot do this using the "Field" option in the advanced search feature as that only allows me to select full template names from a drop down list.

I would appreciate any and all feedback/suggestions!

0 0

Replies

replied on October 29, 2021

You could get a list of these templates and run a search for documents assigned to each one and either assign a new template or just remove the blank one.

{[Template Name]} will search for a documents with a given template.

To get the list of template names, I'd just go through SQL (you can get it from the Admin Console as XML too and parse that in Workflow)

select pset_name from propset
where pset_id not in
(select pset_id from pset_props)

Though....did those templates have meaning and do you need to preserve that info? What is the end goal here?

1 0
replied on October 29, 2021

The goal is to do exactly what you described. Rather than have 150 blank templates, I want to create one new template with a new field that is a drop down list of all the current templates to describe the type of HR document plus the basic employee info fields (name, ID, etc).

I want the workflow to find all current entries with the blank templates, identify the name of the blank template, replace with the new template, and assign the dropdown field to match the previously assigned template.

Once that is done, I would proceed by clearing out all the old blank templates from our template list in the admin console.

 

Your suggestion seems like it is spot on so I will let you know how it goes.

Thank you!

0 0
replied on October 28, 2021 Show version history

If you have a common field, say "Emp Num" then don't choose a template just click the "Choose fields" button

0 0
replied on October 28, 2021

So part of the reason that I am trying to target these templates is because they are all blank, as in they do not have fields assigned to them. They are literally just the template title.

To try your suggestion, would I be able to create a new field unique for this specific use, add it to all those templates, and then search for it?

Or will all those existing templates entries not update to include the new field?

0 0
replied on October 28, 2021

Wow, that's an "interesting" situation.  I think the empty field would be added to each of the existing entries and should let you do the search for a value of *.  Try it on one template and see.

1 0
replied on October 28, 2021 Show version history

I agree, its def not ideal. Unfortunately, that's the nature of dealing with legacy choices. frown

I tried assigning the new field to a document and searching for it and that seemed to work.

The issue now is that in regard to all those HR templates, by "dozens" its really 150+ templates. So I'd have to manually add the new field to all of them first.

I'd like to avoid having to do that so I'll save it as a last resort.

Would you happen to know how to search by template characters?

0 0
replied on October 29, 2021

Not in the application.  I could do a query to find the templates, but it would be a really bad idea to attempt to alter a template in the database.  Maybe someone else know how to accomplish it using the SDK...

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.