Forum Discussion
Auto-Labeling based on data in Document Properties doesn't work
- Aug 12, 2025
Thanks Prathista, I managed to get this working eventually. Titus adds 2 document properties to the labelled document, "TitusGUID:1111ca11-1d11-11b1-1afa-a11d1a1f1a11" and "Classification:Public". I was targeting the GUID field primarily and it never worked so I switched to the classification property which eventually did.
I also had to figure out the process of adding a managed property to the SharePoint search schema. Fortunately I stumbled across this Microsoft article which proved useful. https://techcommunity.microsoft.com/blog/microsoft-security-blog/sensitivity-auto-labelling-via-document-property/4437574
Hello CameronStephens2,
I haven't tried this personally, but based on the research, a few things to consider,
- If you plan to use document properties as a condition (Document property is), this option uses SharePoint managed properties in the same way as they are used for DLP policies. Use exact string matches; regex patterns aren't supported. Refer to: https://learn.microsoft.com/en-us/purview/apply-sensitivity-label-automatically#prerequisites-for-auto-labeling-policies
- Consider using only letters and digits in managed property names. Although it is possible to create custom managed properties with special characters (such as hyphens, dots, and underscores), many of those characters act as operator characters in the query syntax. For example, a hyphen means negation. Such property names have to be enclosed in double quotation marks when used in queries. Many tools and applications that create queries don’t handle this correctly, and therefore it is better to use only letters and digits in managed property names. Refer to: https://learn.microsoft.com/en-us/sharepoint/manage-search-schema#create-a-new-managed-property
- Also explore trainable classifiers/document fingerprinting if that fits your scenario.
Refer to: Get started with trainable classifiers | Microsoft Learn
About document fingerprinting | Microsoft Learn
Hope this helps!
Regards,
PI
Please mark as solution, if you find the answer helpful. This will assist others in the community who encounter a similar issue, enabling them to quickly find the solution and benefit from the guidance provided.
Thanks Prathista for your reply, but I managed to get it working in the end.
Titus adds 2 document properties to a file, and I was targeting the first "TitusGUID:1111ab11-1a11-11a1-1abc-a11a1a1a1a11". This never worked, so I updated the policy and targeted the second "Classification:Public", which did.
It took a bit longer for me to realise what the problem was because I also needed to add a managed property to SharePoint search schema and link it to one of the crawled properties above which I had sort of done, but not completely. This recent MS article helped me to better understand the process https://techcommunity.microsoft.com/blog/microsoft-security-blog/sensitivity-auto-labelling-via-document-property/4437574/replies/4440897