SharePoint CAML Files: When to Use Curly Brackets with GUIDs

Learn when to use curly brackets in SharePoint CAML files when creating a GUID. Follow these guidelines for SharePoints Sites.

When working in any of the myriad of SharePoint CAML files (*.xml) found in the 12 system folder, developers will always come to the point where they need to create a GUID. Unfortunately sometimes you need to put the curly brackets {} around the GUID in order for it to work, whatever it may be (Feature definition, site column definition, solution manifest, etc), other times you can’t put the curly brackets in and the most fun of all, those times when it just doesn’t matter.

One rule I like to live by is to never use the curly brackets on any GUID unless I’m working with site column definitions or references to those site columns from within a content type definition. I’ve been following this self guidance and advising my students of it for the last year and so far no problems! Figured I’d pass it along as I see the question come up a few times in the MSDN forums.

Yes, I know my custom commands add the {} to the content type definition… that’s been fixed in an internal build that I’ll share in the coming weeks.

Andrew Connell
Developer & Chief Course Artisan, Voitanos LLC. | Microsoft MVP
Written by Andrew Connell

Andrew Connell is a full stack developer who focuses on Microsoft Azure & Microsoft 365. He’s a 20+ year recipient of Microsoft’s MVP award and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s mission is to help web developers become experts in the Microsoft 365 ecosystem, so they can become irreplaceable in their organization.

Share & Comment