caml
8 TopicsUsing CAML queries in SPFx or SharePoint PnP
I am attempting to recreate a webpart I made for SharePoint classic as a SharePoint modern webpart. I need to use a CAML query to get the one person who is on-call in our department (kept in a SharePoint calendar). I can only find very simple query examples but I need to use a complex CAML query. 1) can someone show me where to find documentation on what I am trying to do 2) can someone tell me what I am doing wrong in this code. private getOnCall(): void { const context: SP.ClientContext = new SP.ClientContext(this.properties.siteUrl); const list: SP.List = context.get_web().get_lists().getByTitle('On Call'); context.loadQuery(list, '<View><ViewFields><FieldRef Name="Title" /><FieldRef Name="EventDate" /><FieldRef Name="EndDate" /></ViewFields><Query><Where>' + '<And><Contains><FieldRef Name="Title" /><Value Type="Text">On-Call</Value></Contains><And><Leq><FieldRef Name="EventDate" /><Value IncludeTimeValue="True" Type="DateTime">' + '<Today /></Value></Leq><Geq><FieldRef Name="EndDate" /><Value IncludeTimeValue="True" Type="DateTime"><Today /></Value></Geq></And></And></Where></Query></View>'); context.executeQueryAsync((sender: any, args: SP.ClientRequestSucceededEventArgs): void => { const listEnumerator: IEnumerator<SP.ListItem> = list.getEnumerator(); var title: string; while (listEnumerator.moveNext()) { const item: SP.ListItem = listEnumerator.get_current(); title = item.get_item('Title'); } }, (sender: any, args: SP.ClientRequestFailedEventArgs): void => { } }7.7KViews0likes2CommentsCAML query to filter List items on the basis of Current User group in sharepoint
I have List library which having column Name-Vendor, also I have differ sharepoint user groups for each vendor. I am using CAML query to filter List items, so user can see list items belong to its vendor group only. I am filtering List items using CAML query where value of currentuser group will be same as Value in Column of list items-Vendor I am using following CAML query, is this correct, I am not getting expected filter result. <Where><Eq><FieldRef Name="User_ID"/><Value Type="Text">911</Value></Eq><Membership Type="CurrentUserGroups"><FieldRef Name='Vendor' /></Membership></Where>Solved6.2KViews0likes2Commentsfiltering list items using CAML query for currentuser group
I am using CAML query to filter list items on the basis of user group. <Membership Type=\"CurrentUserGroups\"><FieldRef Name=\"Vendor\"/></Membership> but above query not working, do i need to put \ in above query? if I put \ before Vendor , it throwing error , but no error for \ before currentusergroups what is purpose of this \ and whats wrong with my query? i have created sharepoint group and the granted full access to given list for group , then trying to filter list items on the basis of CAML query and current user group so only list items having value in Vendor column equal to current users sharepoint group can visible to that user?can anyone helpSolved2.4KViews0likes2CommentsCAML query giving error
I want to filter list items on the basis of currentuser group so list items with Vendor column having value same as currentuser group only can see list items I am using following CAML to achieve this, but I am getting error Vendor is column name in list, which i want to compare with currentusergroup name <Query><Where><Membership Type="CurrentUserGroups"><FieldRef Name="Vendor" /></Membership></Where></Query> do I need to add any other Code, why Membership type=CurrentUserGroups not working for me? whats wrong here, on net i found same solution used by many people and they claiming its working for themSolved1.7KViews0likes2CommentsCAML query not working
I want to filter list items on the basis of sharepoint user group name. only list items which having Value in Column-Vendor same as Sharepoint group should able to see that list item. I am using following CAML query <Membership Type="CurrentUserGroups"><FieldRef Name="Vendor"/></Membership> but its not working, I tried following also <Membership Type=\"CurrentUserGroups\"><FieldRef Name=\"Vendor\"/></Membership> but still its not filtering but showing all list items for the user.1.3KViews0likes0CommentsFiltering List items on the basis of sharepoint group using CAML query in sharepoint online classic
I want to filter items of list library on the basis of sharepoint groups. users belong to one sharepoint group-IT can only see list items which having value in one column Vendor='IT' users belong to another sharepoint group -Finance can only see list items which having value in column Vendor='finance' when user visit page he can only see list items which having value in column mapped with user group. how can I achieve this in sharepoint online classic please find following article for solution,will it work? https://www.crowcanyon.help/article/304/ I added following code of CAML query through sharepoint designer to default view, but its not giving expected result where Vendor is column in list which I want to compare with current users sharepoint group. <And><Membership Type="CurrentUserGroups"><FieldRef Name="Vendor"/></Membership></And>1.2KViews0likes0CommentsMembership Tag not working in CAML query sharepoint
I am getting error where using Membership tag <Query><Where><Membership Type="CurrentUserGroups"><FieldRef Name="Vendor" /></Membership></Where></Query> error Correlation ID: 076f579f-20f1-b000-c31a-67e814dcf994 Not sure whats wrong, I am using sharepoint online classic1.1KViews0likes1Commenthow to get maximum of another column for a grouped column
Hello in my SharePoint list I have below columns and meta data: Doc No Rev Doc-0001 00 Doc-0001 01 Doc-0001 02 Doc-0002 00 Doc-0002 01 Now I want below to result in the view or query, that added another column that show maximum Rev for each Doc No Doc No Rev Maximum Rev Doc-0001 00 02 Doc-0001 01 02 Doc-0001 02 02 Doc-0002 00 01 Doc-0002 01 01 I read something about CAML in the NET, but I do not know how I have to use that for solving my problem. Regards, Masoud