Need a dynamic CAML Query for Sharepoint display form

TL 1 Reputation point
2022-04-07T12:31:18.323+00:00

Does anyone have a dynamic CAML query example where it returns all values from the list where the title fields equal the current item title field? I need a code example please. Thank You!
Using SharePoint 2013 lists

<Query>  
  <Where>  
    <And>  
      <Eq>  
        <FieldRef Name="TItle" />  
        <Value Type="text">+ 'Title` +</Value>  
      </Eq>  
      <Eq>  
        <FieldRef Name="Title" />  
        <Value Type="text">?????What would this be???? I was hoping [@Title]</Value>  
      </Eq>  
    </And>  
  </Where>  
</Query>  


  
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,668 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 31,071 Reputation points Microsoft Vendor
    2022-04-08T02:55:46.99+00:00

    Hi @TL ,
    You can try following caml query to filter title fields equal the current item title field

        <View>  
             <Query>  
                <Where>  
                     <Eq>  
                         <FieldRef Name='Title'/>  
                         <Value Type='Text'>your title</Value>  
                     </Eq>  
                </Where>  
            </Query>  
       </View>  
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.