1

I need to find all templates that use a defined field type.

What is the best way to do it ?

3

As field types are not linked with item's ID you cannot use Link Database for that.

PowerShell

You could iterate through all fields in PowerShell and find those with particular field type enter image description here

SQL

Open SQL Management studio Execute something like that

SELECT TOP 1000 
    [ItemId]
    ,[FieldId]
    ,[Value]
    ,[Created]
    ,[Updated]
FROM [sc_sitecore_master].[dbo].[SharedFields]
WHERE FieldId = '{AB162CC0-DC80-4ABF-8871-998EE5D7BA32}' AND Value = 'MY FIELD NAME'

where

  • MY FIELD NAME is a file type name
| improve this answer | |
  • why do you use FieldId and value ? Why field Id is not enough ? – Arbejdsglæde Feb 20 '17 at 12:21
  • {AB162CC0-DC80-4ABF-8871-998EE5D7BA32} in this case is an id of Type field (Sitecore field), notice that query is executed agains SharedFields table not Items – Alan Płócieniak Feb 20 '17 at 12:29
3

I used a variation of Balaji's answer to search for data templates that contain a particular field type (in this case "link"), rather than for content with the field type. This also pops up the results in SPE's nice data grid for printing as HTML or exporting to a spreadsheet.

Get-ChildItem -Path "/sitecore/templates" -Recurse | Where-Object {$_.Fields["{AB162CC0-DC80-4ABF-8871-998EE5D7BA32}"] -like "link"} | Show-ListView -Property FullPath, Id
| improve this answer | |
1

If you have powershell extension, you can try

 Get-ChildItem -Path "/sitecore/content" -Recurse | Where-Object {$_.Fields["{AB162CC0-DC80-4ABF-8871-998EE5D7BA32}"] -like "Text"} 
  • 'Text' is a field type name
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.