passing choice column additionalAttributes in AddFieldAsXml

Regular Contributor

I am using a PnP solution to create a custom solution from

https://github.com/SharePoint/PnP/tree/master/Samples/Provisioning.ReR

 

The method AddFieldAsXml takes somes parameters

If i want to pass a choice column then how we go about puttingthe choices.

 

AddFieldAsXml(requestList, SiteRequestFields.StateML, SiteRequestFields.cmdMultipleDisplayName, SiteRequestFields.cmdMultipleDisplayId, "Choice", "Format='Dropdown' Xml='<Choices><Choice>Test1</Choice><Choice>Test2</Choice><Choice>Test3</Choice></Choices>'");

 

However the above code did not work.

 

Thanks

1 Reply

Per link below, choice XML elements should be all caps (XML is case sensitive).  I haven't tested this yet though.

 

https://sharepoint.stackexchange.com/questions/199454/create-choice-column-in-sharepoint-list