For those trying to clean up their templates, I have some goodies for you. | Community
Skip to main content
RandyRoberts
Community Advisor
Community Advisor
September 19, 2022

For those trying to clean up their templates, I have some goodies for you.

  • September 19, 2022
  • 8 replies
  • 4745 views

The following filters are for a template report. They should help you see which templates are being used, or not. How often, or not. And when.

Associated CUR PLN ONH projects (projects made from these templates are in progress)

EXISTS:a:$$EXISTSMOD=EXISTS EXISTS:a:$$OBJCODE=PROJ EXISTS:a:statusEquatesWith=CUR PLN ONH EXISTS:a:statusEquatesWith_Mod=in EXISTS:a:templateID=FIELD:ID isActive=true isActive_Mod=eq


Associated Projects in Past year (these templates got used this year)

EXISTS:a:$$EXISTSMOD=EXISTS EXISTS:a:$$OBJCODE=PROJ EXISTS:a:entryDate=$$NOW-1y EXISTS:a:entryDate_Mod=gte EXISTS:a:templateID=FIELD:ID isActive=true isActive_Mod=eq


Associated Projects (these templates got used at some point)

EXISTS:a:$$EXISTSMOD=EXISTS EXISTS:a:$$OBJCODE=PROJ EXISTS:a:templateID=FIELD:ID isActive=true isActive_Mod=eq


No Associated CUR PLN ONH projects (no projects made from this template are currently open)

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=PROJ EXISTS:a:statusEquatesWith=CUR PLN ONH EXISTS:a:statusEquatesWith_Mod=in EXISTS:a:templateID=FIELD:ID isActive=true isActive_Mod=eq


No Associated Projects in Past year (this template hasn't been used in a year)

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=PROJ EXISTS:a:entryDate=$$NOW-1y EXISTS:a:entryDate_Mod=gte EXISTS:a:templateID=FIELD:ID isActive=true isActive_Mod=eq


No Associated Projects (this template has never been used)

EXISTS:a:$$EXISTSMOD=NOTEXISTS EXISTS:a:$$OBJCODE=PROJ EXISTS:a:templateID=FIELD:ID isActive=true isActive_Mod=eq

8 replies

MoniqueEvans
Community Advisor
Community Advisor
September 21, 2022

This is awesome!!! I haven't tried any of these yet but do you know if these will show templates that are attached second and beyond to a project (if you're doing a modular/add-on process) or only templates used to initially create projects?

RandyRoberts
Community Advisor
Community Advisor
September 22, 2022

Hi Monique,

 

Unfortunately, WF does not consider a secondary or sub-template on the project level, only the task level. These filters only consider projects. If you create or attach a template to a project and then look at the template in the overview, it will display that template. If you then attach a second template, that template will not be associated at the project level. I guess that keeps templates from being collections, which has its own set of limitations.

If you add a "Template" column to the tasks list for the project, it will show you which tasks came from which template. here is the code for a template column at the task level:

displayname=Template
linkedname=templateTask
namekey=view.relatedcolumn
namekeyargkey.0=templateTask
namekeyargkey.1=name
querysort=templateTask:template::name
styledef.case.0.comparison.icon=false
styledef.case.0.comparison.leftmethod=percentComplete
styledef.case.0.comparison.lefttext=percentComplete
styledef.case.0.comparison.operator=lte
styledef.case.0.comparison.operatortype=double
styledef.case.0.comparison.righttext=100
styledef.case.0.comparison.trueproperty.0.name=textcolor
styledef.case.0.comparison.trueproperty.0.value=b8b8b8
styledef.case.0.comparison.truetext=
textmode=true
valuefield=templateTask:template:name
valueformat=HTML

 

What you could do (if you really wanted to) is to change the EXISTS statement to filter for tasks, not projects. It would have to cycle through each task so it wouldn't be very efficient, if it worked at all (and I'm not sure it would). Maybe @doug_den_hoed__atappstore  has an opinion on if that would work!

MoniqueEvans
Community Advisor
Community Advisor
September 22, 2022

Thanks Randy. I was "leading the class" with that question as this came up earlier this week in one of the CS@Scale events around templates and wanted to make sure everyone else understood this fully.

I appreciate you adding the template task column text mode, I feel this will be really helpful for a lot of folx, myself included!

quarkmage
Level 3
November 4, 2022

Yes! Love the clean-up topics.
My first use of text-mode as well, thank you @randyroberts 

No Associated Projects filter returned 122 templates....oh my.

 

Lyndsy-Denk
Community Advisor
Community Advisor
January 5, 2023

This is making so many dreams come true!

I could use some help with at least one of these filters, though. I tried the Associated CUR PLN ONH projects and received zero hits until I adjusted the line statusEquatesWith down to just one status (ex. CUR). How do I get the filter to accommodate "or" logic to capture all three?

RandyRoberts
Community Advisor
Community Advisor
January 6, 2023

try making sure it's a tab between the statuses, not a space. It looks like copying it to the forum changed all the tabs to spaces.

Lyndsy-Denk
Community Advisor
Community Advisor
January 6, 2023

Bingo! That's exactly what happened. Thanks!

KierstenKollins
Community Advisor
Community Advisor
January 26, 2023

These are awesome! Thanks for sharing with us all! 

RhondaGayleTX
Level 5
May 23, 2023

you l know what I love about threads like this? Learning! I feel like every time I study exists statements and other text mode, it helps me gain a better understanding of how it all works...  which gives me ideas of other things to try! Thanks for sharing so much detail to help us all learn 🙂 

amybillmayer
Level 4
January 3, 2024

Ok, this is absolutely AMAZING! Thank you so much for sharing. I still don't have the hang of using EXISTS, so these snippets will really come in handy!

Level 2
June 4, 2024

I was looking at this thread and was wondering what happened to the original solution. I'm definitely still in need of something like this!

 

Thanks!

RandyRoberts
Community Advisor
Community Advisor
June 7, 2024

The code has been restored

 

FYI @jon_chen

Level 2
July 22, 2024

Thanks @randyroberts !

June 17, 2025

Hi, I am doing a clean-up exercise and wanted to check the last time a Project template was used to create a project. Is there anyone who was able to do a similar exercise? 

Sven-iX
Community Advisor
Community Advisor
June 17, 2025

So if you're looking for "projects that were created based on template X" you can run a report on projects and use the Template ID or name in the report. 

 

However this does NOT cover projects where a template was attached after creation. 

 

RandyRoberts
Community Advisor
Community Advisor
June 17, 2025

To expand on this: To filter for templates that were added later, you would have to go by the tasks it created, if any. Templates that were added later only to change settings or add queue topics would be trickier.