Community forums
ViewXML Property in Widget Builder
Quote from Jermaine Snipe on December 3, 2019, 6:42 pmHas anyone has success implementing the viewxml property for a widget instance in the config.json file? For example, I've tried converting this XML to JSON:
<view><Query><OrderBy><FieldRef Name='CopyRightOrder' Ascending='TRUE' /></OrderBy><Where><Eq><FieldRef Name="CopyRightActive" /><Value Type="Boolean">1</Value></Eq></Where></Query></view>
However, the viewxml property has thrown errors every time. Thanks in advance for your help.
Has anyone has success implementing the viewxml property for a widget instance in the config.json file? For example, I've tried converting this XML to JSON:
<view><Query><OrderBy><FieldRef Name='CopyRightOrder' Ascending='TRUE' /></OrderBy><Where><Eq><FieldRef Name="CopyRightActive" /><Value Type="Boolean">1</Value></Eq></Where></Query></view>
However, the viewxml property has thrown errors every time. Thanks in advance for your help.
Quote from Scott Kearney on December 5, 2019, 10:34 amTry using this known good as your starting point:
{"name": "viewxml","value": "<View><Query><OrderBy><FieldRef Name='ProductCarouselItemOrder' Ascending='TRUE'></FieldRef></OrderBy><Where><Eq><FieldRef Name='ProductCarouselActive' /><Value Type='Boolean'>1</Value></Eq></Where></Query><RowLimit>12</RowLimit></View>"},Also, try running the CAML query - does it function properly?
Try using this known good as your starting point:
Quote from Jermaine Snipe on December 5, 2019, 11:38 amThanks sir; the only difference was that I had a lowercase "v" for "view", whereas your version has a uppercase "V" for "View". Once I made that change it worked.
Thanks sir; the only difference was that I had a lowercase "v" for "view", whereas your version has a uppercase "V" for "View". Once I made that change it worked.