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 web & cloud developer with a focus on Microsoft Azure & Microsoft 365. He’s received Microsoft’s MVP award every year since 2005 and has helped thousands of developers through the various courses he’s authored & taught. Andrew’s the founder of Voitanos and is dedicated to helping you be the best Microsoft 365 web & cloud developer. He lives with his wife & two kids in Florida.

Share & Comment