J King
J King

Reputation: 4434

can not perform valueFIlter in visual query on boolean value

here is the json data that the visual query returns with no valueFilter:

{
  "Default": [
    {
      "Title": "Demo Image",
      "Id": 2062,
      "Description": "<p>Wonderful Description Goes here</p>",
      "Available": true,
      "Image": "/Portals/29/gallery/image-holder.jpg",
      "Category": "Landscapes"
    },
    {
      "Title": "Second Image",
      "Id": 2179,
      "Description": "<p>More info about gallery item</p>",
      "Available": true,
      "Image": "/Portals/29/adam/Image Gallery/d_1cnVC7ok2XkNwelFfzxw/Image/NorthEastWomensVids.jpeg",
      "Category": "Landscapes"
    },
    {
      "Title": "Krisis",
      "Id": 2191,
      "Description": "<p>Super duper</p>",
      "Available": true,
      "Image": "/Portals/29/adam/Image Gallery/5lWMBOhQrU240JeahWVojg/Image/11L202413A.jpg",
      "Category": "Landscapes"
    },
    {
      "Title": "Banff Mountain",
      "Id": 2195,
      "Description": "<p>Acrylic on canvas - 24-38 inches</p>",
      "Available": false,
      "Image": "/Portals/29/adam/Image Gallery/8rD59K5dikald8csgfGbiA/Image/Cheryl_Muth_Painting-28.jpg",
      "Category": "Landscapes"
    },
    {
      "Title": "Dark mountain day",
      "Id": 2196,
      "Description": "<p>acrylic on canvas - 32x38 inches</p>",
      "Available": false,
      "Image": "/Portals/29/adam/Image Gallery/GNm6lv__sU-3jsfxtFOMIQ/Image/Cheryl_Muth_Painting-32.jpg",
      "Category": "Portraits"
    },
    {
      "Title": "jans painting",
      "Id": 2197,
      "Description": "<p>acrylic on canvas 45x33 inches</p>",
      "Available": true,
      "Image": "/Portals/29/adam/Image Gallery/3GvRbdwiUUSRieqBro8nBQ/Image/jans_painting.jpg",
      "Category": "Flowers"
    }
  ]
}

If I add a value filter to the visual query and specify the Attribute = Category and the Value = Landscapes, then when I test the query I get only the landscapes items.

However the problem is when I try to perform a value filter on the Available attribute. It is a boolean field value with a yes no toggle in the entry form.

If I set the valueFilter Attribute to Category and the value to either "true/false" "yes/no" or "1/0" I get no records of any kind.

Can you help me figure out why I can not perform a valueFilter on a boolean field.

I am using the latest release of 2sxc

Thanks

Upvotes: 0

Views: 49

Answers (1)

J King
J King

Reputation: 4434

SOLUTION:

It was a case issue.

When I am trying to perform a value filter in the visual query on a boolean / "yes-no" field, using lower case did not work.

For example I had to use True or False NOT true or false in the value field for the filter. This was a little misleading as the returned json results use lower case as seen by the actual results below:

{
  "Default": [
    {
      "Title": "Banff Mountain",
      "Id": 2195,
      "Description": "<p>Acrylic on canvas - 24-38 inches</p>",
      "Available": false,
      "Image": "/Portals/29/adam/Image Gallery/8rD59K5dikald8csgfGbiA/Image/Cheryl_Muth_Painting-28.jpg",
      "Category": "Landscapes"
    },
    {
      "Title": "Dark mountain day",
      "Id": 2196,
      "Description": "<p>acrylic on canvas - 32x38 inches</p>",
      "Available": false,
      "Image": "/Portals/29/adam/Image Gallery/GNm6lv__sU-3jsfxtFOMIQ/Image/Cheryl_Muth_Painting-32.jpg",
      "Category": "Landscapes"
    }
  ]
}

Upvotes: 0

Related Questions