7

In case, the District is a single line of text, try the below code using (SPSite site = new SPSite("SiteURL")) { using (SPWeb web = site.OpenWeb()) { SPList list = web.Lists["ListName"]; SPQuery query = new SPQuery(); query.Query = "<View><ViewFields><FieldRef Name='District'/></ViewFields></View&...


3

How I can specify does not contain inside CAML? As a short answer, Unfortunately, you CAN'T. There isn't <NOT Contain> element or any equivalent for <NOT Contain> in Query schema elements Workarounds You can get the "<FieldRef Name='ResultMessage'/>" and perform logical comparing like if (!string.Contains("fail") && !string....


3

This isn't a SharePoint-related question as we're just talking about SMTP mail. With Exchange Online, you have a few options you can evaluate; these will use username/password as SMTP relays are not compatible with OAuth. Option 2 or 3 should fit your needs.


2

You can always, although it is not recommend, hide buttons with css, with the help of a spfx application customizer. Lets say you want to hide the "new button", just need to make yout spfx extension import a custom css or sass file with: button[data-automationid="newCommand"] { display: none; }


2

By far the best example with sample code: https://developer.microsoft.com/en-us/office/blogs/new-sharepoint-csom-version-released-for-Office-365-september-2017/


2

Try debugging your remote event receiver locally as given in the below article: Remote Event Receivers – you’re all doing it wrong. In order to use this you will need the following things. Node.JS and ngrok. Then Start ngrok service and create a RER which points to your ngrok service, instead of real URL. Then test your RER locally in Visual Studio. ...


2

The following steps for your reference. 1.Create a console application using visual studio. 2.Install the package using the NuGet below. Install-Package Microsoft.SharePointOnline.CSOM -Version 16.1.19515.12000 3.Refer to the code example below to get list items versions. using Microsoft.SharePoint.Client; using System; using System.Security; namespace ...


2

Please refer this article. In short, you have to refer the newly released CSOM package 16.1.6906.1200 or higher. You can find the latest CSOM package for SharePoint Online from the NuGet gallery with an id of ‘Microsoft.SharePointOnline.CSOM‘. Adding the code sample below. // Get versions of specific document from library - item and file List list = ctx....


2

In PowerApps managed metadata column shows up as a drop-down menu and There is no (out of the box) way to show the "tree structure" of terms. Source: PowerApps and managed metadata. Multi-valued managed metadata columns are fully supported in PowerApps. Source: Tips and Tricks for multiselect controls with advanced tagging options.


2

Use<Neq> </Neq> instead: <View> <Query> <Where><And><Neq><FieldRef Name='ResultMessage' /><Value Type='Text'>success</Value></Neq><Neq><FieldRef Name='ResultMessage' /><Value Type='Text'>fail</Value></Neq></And></Where> </...


2

You need update folder metadata for the root folders after run the MoveTo method, modify the code as below. if (currentItem.ContentType.Name.ToLower().Contains("project")) { Console.WriteLine(currentItem["ID"]); SPFolder folder = omsWeb.GetFolder(omsWeb.ServerRelativeUrl + "/Shared Documents/"+currentItem["ID"].ToString()); var modified = folder....


2

Install the SharePoint 2019 CSOM library using the NuGet below. Install-Package Microsoft.SharePoint2019.CSOM -Version 16.0.10337.12109 Then use the methods of MoveCopyUtil class to copy/move folders and files. Example: string dstUrl = "http://sp2019/sites/team1"; string sourceFolder = "http://sp2019/sites/team1/libraryname/folder1"; string destFolder = ...


2

To include multiple taxonomy values, the values should be separated by ;#. Example: 44;#USA|c1815b1d-346f-4ce1-b2cb-15df5e12b0b3;#45;#INDIA|e141d775-7a3b-40aa-a680-98039b375828 Source: Update Managed Metadata column Default Value(s) using CSOM - C#


2

This will not modify the site at all, it will just export the template No data will be included You must first create a new site (or modify an existing one). You do that by using the command Apply-PnPProvisioningTemplate -Path template.pnp. More details here This will use the current folder, but you can specify where you want it: Get-PnPProvisioningTemplate -...


2

When you call Load, you are only preparing your query. As this article states, in SQL terms think of it of building your SELECT statement. You then call ExecuteQuery() (or ExecuteQueryAsync()), to submit your prepared query to the remote server and retrieve the specified data. The difference between ExecuteQuery() and ExecuteQueryAsync() is whether you ...


2

You can use the same System.Net.Mail.MailMessage class and just supply your outbound SMTP configuration. How you configure your SMTP service is out of scope of this network, though. If you don't have an available SMTP service/server, you may want to post over at ServerFault.


2

Yes, both of these methods will work even if you have millions of list items. The reason it will work is that you are not retrieving more than one item. You are also not sorting by an un-indexed column in your query. And your query does not use "contains" condition either.


2

Try something like below: List<FieldUserValue> currentgroupUsers = new List<FieldUserValue>(); foreach (User user2 in group.Users) { var userLookupValue = new FieldLookupValue { LookupId = user2.Id }; currentgroupUsers.Add(userLookupValue); } oListItem["PersonOrGroupField"] = currentgroupUsers.ToArray(); oListItem.Update(); context....


2

If the lookup column does not allow to select multiple values then you should try your query like: <Where> <Or> <Eq> <FieldRef Name='NetworkNodes'/> <Value Type='Lookup'>SRV1</Value> </Eq> <Eq> <FieldRef Name='NetworkNodes'/> <...


2

You cannot change the internal name of a field once created. That is by design. You will have to delete and recreate the field.


2

You won't be able to do it without CDS. The state of Flow and approval are managed in CDS and data spreads across multiple entities. This is not easy to understand but if you give enough time you may understand it. Having said that I came across entities that cannot be edited by user (I am still working on this part) These entities manage all complex and ...


1

Here is an updated guide. It seems to me that these are the steps to follow. Can you elaborate on the problem you're facing?


1

I suspect that ArchItems is a library not a list as You are trying to move a file to it. If so then the link to a document library is without '/lists'/ because libraries are like 'folders' on web. Please try to change the line file.MoveTo(omsWeb.ServerRelativeUrl + "/lists/ArchItems/" + currentItem.ID.ToString() + "_.000"); to file.MoveTo(...


1

AFAIK, properties.ItemEventProperties doesn't have the current item. but it has the listid and itemid, so using that we can fetch it from the list and use it. using (ClientContext clientContext = TokenHelper.CreateRemoteEventReceiverClientContext(properties)) { if(clientContext != null) { List requestList = clientContext.Web.Lists.GetById(...


1

In SharePoint, Date and Time Field takes date in ISO Format. So, try converting date-time value in ISO format and then use it. Try below solutions: Converting to ISO Format: DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ssZ"); Given a DateTime object, how do I get an ISO 8601 date in string format? Try using Invariant Date Format: DateTime.Now.ToString(...


1

We can add the CSS style below into script editor web part in list form page to achieve it. <style> #ui-accordion-accordion-panel-0{ height:auto !important; } </style>


1

For GeoLocationField: Assuming you have fetched the list items you want to update in oListItem then try something like below: FieldGeolocationValue oGeolocationValue = new FieldGeolocationValue(); oGeolocationValue.Latitude = (double)17.4; oGeolocationValue.Longitude = (double)78.4; oListItem["Address"] = oGeolocationValue; oListItem.Update(); context....


1

Several things to try: Instead of foreach loops, switch them out for 'for' loops, they have been proven to be faster: https://www.c-sharpcorner.com/article/for-vs-foreach-in-c-sharp/ I'd look into concatenation of string more efficiently: https://stackoverflow.com/questions/21078/most-efficient-way-to-concatenate-strings I'd replace all instances of ...


1

You can parse this url with regular expressions. This code should work with your example url: string s = "http://rvsp2019/sites/firstsite/_api/web/GetList(@v1)/RenderExtendedListFormData(itemId=16,formId=%27editform%27,mode=%272%27,options=7)?@v1=%27%2Fsites%2Ffirstsite%2FDL%27"; Match match = Regex.Match(s, @"itemid=(\d+)",RegexOptions.IgnoreCase); if (...


1

It is supported in PowerApps. I’ve tested in a simple list with 5 single line of text fields, named A~E. For example, when I check the Checkbox control, the field A and B will be invisible and be replaced by fields C~E. Please see the steps below: Select Data Card for field A and switch to “Visible” under properties. Type If(Checkbox2.Value=false,true,...


Only top voted, non community-wiki answers of a minimum length are eligible