SlideShare a Scribd company logo
1 of 23
CAML is NOT dead!


   Andy Van Steenbergen
       Karine Bosch
        SharePoint MVP
A big thanks to our sponsors
Platinum Sponsors




Gold Premium Sponsors            Venue Sponsor




Gold Sponsors
About Us
•   Karine Bosch
•   SharePoint MVP since 2009
•   Technical assistent of Patrick Tisseghem till September 2008
•   Developer of the U2U CAML Builder
•   Technical Lead SharePoint Competence Center @ ING




•   Andy Van Steenbergen
•   SharePoint consultant @ Ordina
•   Vice-president BIWUG
Agenda


•   What is CAML?
•   CAML Basics
•   CAML Deep Dive
•   The new CAML Designer
What is CAML?
•   Collaborative Application Markup Language
•   XML-based query language
•   Introduced in SharePoint 2001
•   SharePoint 2010: LINQ to SharePoint
The Basics
•   Ordery By
•   Where
•   ViewFields
•   Query options
Order By Clause
•   To sort list items
     • In ascending order
                 <OrderBy>
                  <FieldRef Name=“Title” />
                 </OrderBy>


     • In descending order
                 <OrderBy>
                  <FieldRef Name=“Title” Ascending=“False” />
                 </OrderBy>

     • On more than 1 field
                 <OrderBy>
                  <FieldRef Name=“Title” />
                  <FieldRef Name=“LastName” Ascending=“False”/>
                 </OrderBy>
Where Clause
•   Operators
     • IsNull - IsNotNull
     • Eq – Neq
     • Geq – Gt – Leq – Lt
     • BeginsWith
     • Contains
     • Includes
     • In
•   Example of a simple syntax:
          <Where>
             <Eq>
                <FieldRef Name=“LastName” />
                <Value Type=“Text”>Van Steenbergen</Value>
             </Eq>
          </Where>
Where Clause
•   More than one criterium
     • Nested XML
     • And / Or operators
•   Example of a nested syntax
         <Where>
            <Or>
               <Eq>
                  <FieldRef Name=“LastName” />
                  <Value Type=“Text”>Van Steenbergen</Value>
               </Eq>
               <Eq>
                  <FieldRef Name=“LastName” />
                  <Value Type=“Text”>Bosch</Value>
               </Eq>
            </Or>
         </Where>
Where Clause
•   Example of a complex syntax
          <Where>
             <Or>
                <Or>
                   <Eq>
                      <FieldRef Name=“LastName” />
                      <Value Type=“Text”>Van Steenbergen</Value>
                   </Eq>
                   <Eq>
                      <FieldRef Name=“LastName” />
                      <Value Type=“Text”>Bosch</Value>
                   </Eq>
                </Or>
                <Gt>
                   <FieldRef Name=“DownloadStart” />
                   <Value Type=“DateTime”>2012-04-28T00:00:00Z</Value>
                </Gt>
             </Or>
          </Where>
Where Clause for DateTime fields
•   DateTime Fields
     • Query on date only
              <Where>
                 <Gt>
                    <FieldRef Name=“DownloadStart” />
                    <Value Type=“DateTime”>2012-04-28T00:00:00Z</Value>
                 </Gt>
              </Where>

     • Query on date and time value
              <Where>
                 <Gt>
                    <FieldRef Name=“DownloadStart” IncludeTimeValue=“True”/>
                    <Value Type=“DateTime”>2012-04-28T00:00:00Z</Value>
                 </Gt>
              </Where>
Where Clause for Lookup fields
•   Lookup fields
     • Query on lookup value
              <Where>
                 <Eq>
                    <FieldRef Name=“Country” />
                    <Value Type=“Lookup”>Belgie</Value>
                 </Eq>
              </Where>

     • Query on ID
              <Where>
                 <Eq>
                    <FieldRef Name=“Country” LookupId=„True‟/>
                    <Value Type=“Integer”>15</Value>
                 </Eq>
              </Where>
ViewFields Clause
•   Restrict the number of fields returned
•   No ViewFields clause
     • Fields of default view are returned
                <ViewFields>
                   <FieldRef Name=“LastName” />
                   <FieldRef Name=“FirstName” />
                </ViewFields>
Query Options
•   RowLimit
•   IncludeMandatoryColumns
•   DatesInUtc
•   ExpandUserField
•   Files and folder options
Query Options and the SharePoint Object Models
• Since SharePoint 2003
    • Server Object Model
    • Lists.asmx web Service


• Since SharePoint 2010
    • .NET Client Object Model
    • Silverlight Client Object Model
    • JavaScript Client Object Model
QUERY OPTIONS
Query Options – Files and Folder options
• Where
    • FSObjType
        • 0 = Files
        • 1 = Folders

• ViewAttributes
    • Scope
        • RecursiveAll
        • Recursive
        • FilesOnly

• Folder
QUERY OPTIONS – FILES AND FOLDERS
Advanced CAML – New elements
•   New CAML elements
     • Includes - NotIncludes
              <Where>
                <Includes>
                   <FieldRef Name=„City' />
                   <Value Type='LookupMulti'>Antwerp</Value>
                </Includes>
              </Where>

     • In
              <Where>
                 <In>
                    <FieldRef Name='Title' />
                    <Values>
                       <Value Type='Text'>Test 1</Value>
                       <Value Type='Text'>Test 2</Value>
                    </Values>
                 </In>
              </Where>
Advanced CAML (vNext)
• New in CAML
   • Taxonomy Fields

• Calendar Lists
   • DateRangesOverlap
• SiteDataQuery
CAML Designer vNext
• Related Lists (caml)
• Content Type Designer
Karine bosch andy-van_steenbergen-caml-spsbe12

More Related Content

Similar to Karine bosch andy-van_steenbergen-caml-spsbe12

Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
Rob Windsor
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
Carol McDonald
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
Sean Cribbs
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWave
Data Works MD
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
WO Community
 
Apache Solr crash course
Apache Solr crash courseApache Solr crash course
Apache Solr crash course
Tommaso Teofili
 

Similar to Karine bosch andy-van_steenbergen-caml-spsbe12 (20)

Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 3: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010Data Access Options in SharePoint 2010
Data Access Options in SharePoint 2010
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 
ERRest - Designing a good REST service
ERRest - Designing a good REST serviceERRest - Designing a good REST service
ERRest - Designing a good REST service
 
Jersey
JerseyJersey
Jersey
 
Rest
RestRest
Rest
 
Rest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.jsRest with Java EE 6 , Security , Backbone.js
Rest with Java EE 6 , Security , Backbone.js
 
Ws rest
Ws restWs rest
Ws rest
 
ApacheCon 2005
ApacheCon 2005ApacheCon 2005
ApacheCon 2005
 
Jstl Guide
Jstl GuideJstl Guide
Jstl Guide
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
Enhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock StructureEnhanced Web Service Testing: A Better Mock Structure
Enhanced Web Service Testing: A Better Mock Structure
 
Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)Introduction to Riak and Ripple (KC.rb)
Introduction to Riak and Ripple (KC.rb)
 
Introducing DataWave
Introducing DataWaveIntroducing DataWave
Introducing DataWave
 
Resource Routing in ExpressionEngine
Resource Routing in ExpressionEngineResource Routing in ExpressionEngine
Resource Routing in ExpressionEngine
 
Web technologies-course 10.pptx
Web technologies-course 10.pptxWeb technologies-course 10.pptx
Web technologies-course 10.pptx
 
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
What is the State of my Kafka Streams Application? Unleashing Metrics. | Neil...
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 
Apache Solr crash course
Apache Solr crash courseApache Solr crash course
Apache Solr crash course
 
Everybody Loves AFNetworking ... and So Can you!
Everybody Loves AFNetworking ... and So Can you!Everybody Loves AFNetworking ... and So Can you!
Everybody Loves AFNetworking ... and So Can you!
 

More from BIWUG

More from BIWUG (20)

Biwug20190425
Biwug20190425Biwug20190425
Biwug20190425
 
Working with PowerShell, Visual Studio Code and Github for the reluctant IT Pro
Working with PowerShell, Visual Studio Code and Github for the reluctant IT ProWorking with PowerShell, Visual Studio Code and Github for the reluctant IT Pro
Working with PowerShell, Visual Studio Code and Github for the reluctant IT Pro
 
Global Office 365 Developer Bootcamp
Global Office 365 Developer BootcampGlobal Office 365 Developer Bootcamp
Global Office 365 Developer Bootcamp
 
Deep dive into advanced teams development
Deep dive into advanced teams developmentDeep dive into advanced teams development
Deep dive into advanced teams development
 
SharePoint wizards - no magic needed, just use Microsoft Flow
SharePoint wizards - no magic needed, just use Microsoft FlowSharePoint wizards - no magic needed, just use Microsoft Flow
SharePoint wizards - no magic needed, just use Microsoft Flow
 
Make IT Pro's great again: Microsoft Azure for the SharePoint professional
Make IT Pro's great again: Microsoft Azure for the SharePoint professionalMake IT Pro's great again: Microsoft Azure for the SharePoint professional
Make IT Pro's great again: Microsoft Azure for the SharePoint professional
 
Modern collaboration in teams and projects with Microsoft 365
Modern collaboration in teams and projects with Microsoft 365Modern collaboration in teams and projects with Microsoft 365
Modern collaboration in teams and projects with Microsoft 365
 
Mining SharePoint data with PowerBI
Mining SharePoint data with PowerBIMining SharePoint data with PowerBI
Mining SharePoint data with PowerBI
 
Don't simply deploy, transform! Build your digital workplace in Office 365
Don't simply deploy, transform! Build your digital workplace in Office 365Don't simply deploy, transform! Build your digital workplace in Office 365
Don't simply deploy, transform! Build your digital workplace in Office 365
 
Connect SharePoint Framework solutions to APIs secured with Azure AD
Connect SharePoint Framework solutions to APIs secured with Azure ADConnect SharePoint Framework solutions to APIs secured with Azure AD
Connect SharePoint Framework solutions to APIs secured with Azure AD
 
Cloud First. Be Prepared
Cloud First. Be PreparedCloud First. Be Prepared
Cloud First. Be Prepared
 
APIs, APIs Everywhere!
APIs, APIs Everywhere!APIs, APIs Everywhere!
APIs, APIs Everywhere!
 
Advanced PowerShell for Office 365
Advanced PowerShell for Office 365Advanced PowerShell for Office 365
Advanced PowerShell for Office 365
 
New era of customizing site provisioning
New era of customizing site provisioningNew era of customizing site provisioning
New era of customizing site provisioning
 
Understanding SharePoint Framework Extensions
Understanding SharePoint Framework ExtensionsUnderstanding SharePoint Framework Extensions
Understanding SharePoint Framework Extensions
 
Microsoft Flow in Real World Projects: 2 Years later & What's next
Microsoft Flow in Real World Projects: 2 Years later & What's nextMicrosoft Flow in Real World Projects: 2 Years later & What's next
Microsoft Flow in Real World Projects: 2 Years later & What's next
 
Microsoft Stream - Your enterprise video portal unleashed
Microsoft Stream - Your enterprise video portal unleashedMicrosoft Stream - Your enterprise video portal unleashed
Microsoft Stream - Your enterprise video portal unleashed
 
What's new in SharePoint Server 2019
What's new in SharePoint Server 2019What's new in SharePoint Server 2019
What's new in SharePoint Server 2019
 
Why you shouldn't probably care about Machine Learning
Why you shouldn't probably care about Machine LearningWhy you shouldn't probably care about Machine Learning
Why you shouldn't probably care about Machine Learning
 
Transforming your classic team sites in group connected team sites
Transforming your classic team sites in group connected team sitesTransforming your classic team sites in group connected team sites
Transforming your classic team sites in group connected team sites
 

Recently uploaded

Recently uploaded (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Karine bosch andy-van_steenbergen-caml-spsbe12

  • 1. CAML is NOT dead! Andy Van Steenbergen Karine Bosch SharePoint MVP
  • 2. A big thanks to our sponsors Platinum Sponsors Gold Premium Sponsors Venue Sponsor Gold Sponsors
  • 3. About Us • Karine Bosch • SharePoint MVP since 2009 • Technical assistent of Patrick Tisseghem till September 2008 • Developer of the U2U CAML Builder • Technical Lead SharePoint Competence Center @ ING • Andy Van Steenbergen • SharePoint consultant @ Ordina • Vice-president BIWUG
  • 4. Agenda • What is CAML? • CAML Basics • CAML Deep Dive • The new CAML Designer
  • 5. What is CAML? • Collaborative Application Markup Language • XML-based query language • Introduced in SharePoint 2001 • SharePoint 2010: LINQ to SharePoint
  • 6. The Basics • Ordery By • Where • ViewFields • Query options
  • 7. Order By Clause • To sort list items • In ascending order <OrderBy> <FieldRef Name=“Title” /> </OrderBy> • In descending order <OrderBy> <FieldRef Name=“Title” Ascending=“False” /> </OrderBy> • On more than 1 field <OrderBy> <FieldRef Name=“Title” /> <FieldRef Name=“LastName” Ascending=“False”/> </OrderBy>
  • 8. Where Clause • Operators • IsNull - IsNotNull • Eq – Neq • Geq – Gt – Leq – Lt • BeginsWith • Contains • Includes • In • Example of a simple syntax: <Where> <Eq> <FieldRef Name=“LastName” /> <Value Type=“Text”>Van Steenbergen</Value> </Eq> </Where>
  • 9. Where Clause • More than one criterium • Nested XML • And / Or operators • Example of a nested syntax <Where> <Or> <Eq> <FieldRef Name=“LastName” /> <Value Type=“Text”>Van Steenbergen</Value> </Eq> <Eq> <FieldRef Name=“LastName” /> <Value Type=“Text”>Bosch</Value> </Eq> </Or> </Where>
  • 10. Where Clause • Example of a complex syntax <Where> <Or> <Or> <Eq> <FieldRef Name=“LastName” /> <Value Type=“Text”>Van Steenbergen</Value> </Eq> <Eq> <FieldRef Name=“LastName” /> <Value Type=“Text”>Bosch</Value> </Eq> </Or> <Gt> <FieldRef Name=“DownloadStart” /> <Value Type=“DateTime”>2012-04-28T00:00:00Z</Value> </Gt> </Or> </Where>
  • 11. Where Clause for DateTime fields • DateTime Fields • Query on date only <Where> <Gt> <FieldRef Name=“DownloadStart” /> <Value Type=“DateTime”>2012-04-28T00:00:00Z</Value> </Gt> </Where> • Query on date and time value <Where> <Gt> <FieldRef Name=“DownloadStart” IncludeTimeValue=“True”/> <Value Type=“DateTime”>2012-04-28T00:00:00Z</Value> </Gt> </Where>
  • 12. Where Clause for Lookup fields • Lookup fields • Query on lookup value <Where> <Eq> <FieldRef Name=“Country” /> <Value Type=“Lookup”>Belgie</Value> </Eq> </Where> • Query on ID <Where> <Eq> <FieldRef Name=“Country” LookupId=„True‟/> <Value Type=“Integer”>15</Value> </Eq> </Where>
  • 13. ViewFields Clause • Restrict the number of fields returned • No ViewFields clause • Fields of default view are returned <ViewFields> <FieldRef Name=“LastName” /> <FieldRef Name=“FirstName” /> </ViewFields>
  • 14.
  • 15. Query Options • RowLimit • IncludeMandatoryColumns • DatesInUtc • ExpandUserField • Files and folder options
  • 16. Query Options and the SharePoint Object Models • Since SharePoint 2003 • Server Object Model • Lists.asmx web Service • Since SharePoint 2010 • .NET Client Object Model • Silverlight Client Object Model • JavaScript Client Object Model
  • 18. Query Options – Files and Folder options • Where • FSObjType • 0 = Files • 1 = Folders • ViewAttributes • Scope • RecursiveAll • Recursive • FilesOnly • Folder
  • 19. QUERY OPTIONS – FILES AND FOLDERS
  • 20. Advanced CAML – New elements • New CAML elements • Includes - NotIncludes <Where> <Includes> <FieldRef Name=„City' /> <Value Type='LookupMulti'>Antwerp</Value> </Includes> </Where> • In <Where> <In> <FieldRef Name='Title' /> <Values> <Value Type='Text'>Test 1</Value> <Value Type='Text'>Test 2</Value> </Values> </In> </Where>
  • 21. Advanced CAML (vNext) • New in CAML • Taxonomy Fields • Calendar Lists • DateRangesOverlap • SiteDataQuery
  • 22. CAML Designer vNext • Related Lists (caml) • Content Type Designer

Editor's Notes

  1. Can only operate on one list
  2. OrderBy clause is not required.