Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [addfieldasxml]

AddFieldAsXml method creates a field based on the specified schema, Boolean value, and field options.

Filter by
Sorted by
Tagged with
1 vote
2 answers
39 views

Roadblocks in adding fields via CSOM in SPO

I have a program that is creating some lists and adding the necessary fields to the lists in SPO. I have marked some of these fields as Required, but in list settings they do not show up as Required. ...
entryton's user avatar
  • 332
0 votes
1 answer
658 views

SharePoint Framework - Create a lookup column using feature

My requirement is to create a Custom List using the Feature (SPFx solution). I have created a custom list using the SPFx feature, I have created a different type of field. But now I want to create a ...
Krunal Patel's user avatar
1 vote
1 answer
227 views

Add Sharepoint calculated field using AddfieldasXML - key cannot be null

I am trying to add a calculated field using the AddFieldAsXML method. And below is how I constructed the field xml. > fieldXML ="<Field ID=\"{ABB544B1-5433-4B49-A629-7B242D3548E5}\" > ...
user38433's user avatar
  • 389
0 votes
1 answer
640 views

Exception calling AddFieldAsXml with "1" argument

I am trying to add the column below via PowerShell <Field ID="{1920c575-d592-40eb-a163-5a302b78aa65}" Type="Note" DisplayName="1920c575d59240eba1635a302b78aa65" StaticName="...
Aslan's user avatar
  • 532
1 vote
1 answer
452 views

SP16 - Cannot create Calculated column with Powershell

This XML syntax is working: $HolidayWorkID = "<Field Type='Number' Name='HolidayWorkID' DisplayName='HolidayWorkID Group='Holidays' />" But this doesn't working: $HolidayReportMonth =...
Goshky's user avatar
  • 2,058
4 votes
0 answers
104 views

How to provision "Content types" in SharePoint online

Short version How do I provision Content Types and Site defs in Sharepoint online, onto my host web? I would prefer reusing existing content type definitions Long version We are migrating a fairly ...
Cowborg's user avatar
  • 1,037
1 vote
1 answer
3k views

add multiple fields using AddFieldAsXml in csom

is it possible to add multiple fields at one go in SharePoint CSOM? I tried List list = context.Web.Lists.GetByTitle(listname); string fieldSchema = "<Field Type='Text' DisplayName=...
Vignesh Subramanian's user avatar
3 votes
1 answer
4k views

How to create lookup field programmatically using AddFieldAsXml Method?

i have two lists(Invoice & Client) which i had created dynamically through code and i want to create lookup field programmatically for relationship between this two list. In Invoice List i have ...
Light's user avatar
  • 215
1 vote
1 answer
757 views

Field names in announcement list in Sharepoint Online

I am trying to add fields to an announcement list. I have successfully added various fields with single-word names: announcementy.Fields.AddFieldAsXml("<Field Type='User' DisplayName='CreatedBy'/&...
grisha's user avatar
  • 2,435
1 vote
1 answer
105 views

Is it actually possible to instantiate SPField?

I want to create a custom List programmatically from scratch: First I add: Guid listID = web.Lists.Add(title, description, SPListTemplateType.GenericList); list = web.Lists[listID]; Then I want to ...
Mariusz Ignatowicz's user avatar
4 votes
1 answer
698 views

AddLookup using the client object model?

Trying (desperately) to find the Microsoft.Sharepoint.Client equivalent of SPList.Fields.Addlookup My code: ClientContext ctx = new ClientContext("http://sharepoint/"); Web website = ctx.Web; ...
Marc's user avatar
  • 41