ListInstance with predefined data in Field tag of Element.xml gives an error
-
08-10-2020 - |
Question
I am trying to add data in Field tag like
<Data>
<Rows>
<Row>
<Field Name='Title'>Configuration</Field>
<Field Name='JSONData'> { "URL":"https://example.com&Isdlg=1")
</Field>
</Row>
</Rows>
</Data>
But it is giving me error on &Isdlg that Isdlg is not defined. I think because of & sign Isdlg is considered as a veriable. So is there is solution to store such data. Thanks in advance
Solution
You could try wrapping it in CDATA tags
<Data>
<Rows>
<Row>
<Field Name='Title'>Configuration</Field>
<Field Name='JSONData'><![CDATA[{ "URL":"https://example.com&Isdlg=1"}]]></Field>
</Row>
</Rows>
</Data>
or escaping the ampersand
<Data>
<Rows>
<Row>
<Field Name='Title'>Configuration</Field>
<Field Name='JSONData'> { "URL":"https://example.com&Isdlg=1"}</Field>
</Row>
</Rows>
</Data>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange