Forum Discussion

null null's avatar
null null
Iron Contributor
Feb 27, 2018

passing choice column additionalAttributes in AddFieldAsXml

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

  • Isaac Olson's avatar
    Isaac Olson
    Copper Contributor

    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

Resources