ViewXML Property in Widget Builder - ViewXML Property in Widget Builder - Community forums - Akumina Community

Community forums

Forum Navigation
Please or Register to create posts and topics.

ViewXML Property in Widget Builder

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.

Try 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?

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.

//]]>