<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Custom object boolean problem in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Custom-object-boolean-problem/m-p/95005#M3386</link>
    <description>&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently having an issue with compiling a custom visual. I have intorduced a custom object (myCustomObj) with a boolean property (myprop). I am following the tutorial here:&amp;nbsp;&lt;A href="https://blogs.msdn.microsoft.com/tsmatsuz/2016/09/27/power-bi-custom-visuals-programming/" target="_blank"&gt;https://blogs.msdn.microsoft.com/tsmatsuz/2016/09/27/power-bi-custom-visuals-programming/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the error "TYPESCRIPT /src/visual.ts : (44,13) Type 'string | number | boolean | Date | Fill | FillRule | ISemanticFilter | DefaultValueDefinition | I...' is not assignable to type 'boo&lt;BR /&gt;lean'.&lt;BR /&gt;Type 'string' is not assignable to type 'boolean'."&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea what the issue could be, it says there is an error with the following line in my update function:&lt;/P&gt;&lt;P&gt;this.myVisualProp = options.dataViews[0].metadata.objects["myCustomObj"]["myprop"];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yet when I put in a debugger and tried&amp;nbsp;typeof(options.dataViews[0].metadata.objects["myCustomObj"]["myprop"]) in the console it returned "boolean". If I am doing something wrong please let me know, my full code is below: visual.ts, capabilities.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;module powerbi.extensibility.visual {

    export class Visual implements IVisual {
        private target: HTMLElement;
        private myVisualProp: boolean;

        constructor(options: VisualConstructorOptions) {
            var captionArea = document.createElement("div");
            captionArea.innerHTML = "This is a test chart";
            options.element.appendChild(captionArea);
            this.target = document.createElement("div");
            options.element.appendChild(this.target);

            this.myVisualProp = false;
        }

        public update(options: VisualUpdateOptions) {
            this.myVisualProp = options.dataViews[0].metadata.objects["myCustomObj"]["myprop"];
            this.target.innerHTML =
                "Custom Prop is " + this.myVisualProp;
                
        }

        public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {
            let objectName = options.objectName;
            let objectEnumeration: VisualObjectInstance[] = [];

            switch (objectName) {
                case 'myCustomObj':
                    objectEnumeration.push({
                        objectName: objectName,
                        properties: {
                            myprop: this.myVisualProp,
                        },
                        selector: null
                    });
                    break;
            };

            return objectEnumeration;
        }

        public destroy(): void {
            //TODO: perform any cleanup tasks here 
        }
    }
}&lt;/PRE&gt;&lt;PRE&gt;{
    "dataRoles": [
        {
            "displayName": "Category Data",
            "name": "category",
            "kind": "Grouping"
        },
        {
            "displayName": "Measure Data",
            "name": "measure",
            "kind": "Measure"
        },
        {
            "displayName": "Grouping",
            "name": "myGroup",
            "kind": "Grouping"
        }
    ],
    "dataViewMappings": [
        {
            "table": {
                "rows": {
                    "select": [
                        {"for": {"in": "myCategory"}},
                        {"for": {"in": "measure"}}
                    ]
                }
            }
        }
    ],
    "objects": {
    "myCustomObj": {
      "displayName": "Test Object",
      "properties": {
        "myprop": {
          "displayName": "Test Property",
          "type": { "bool": true }
                }
            }
        }
    }
}&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Nov 2016 03:00:52 GMT</pubDate>
    <dc:creator>TPreece</dc:creator>
    <dc:date>2016-11-29T03:00:52Z</dc:date>
    <item>
      <title>Custom object boolean problem</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-object-boolean-problem/m-p/95005#M3386</link>
      <description>&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently having an issue with compiling a custom visual. I have intorduced a custom object (myCustomObj) with a boolean property (myprop). I am following the tutorial here:&amp;nbsp;&lt;A href="https://blogs.msdn.microsoft.com/tsmatsuz/2016/09/27/power-bi-custom-visuals-programming/" target="_blank"&gt;https://blogs.msdn.microsoft.com/tsmatsuz/2016/09/27/power-bi-custom-visuals-programming/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting the error "TYPESCRIPT /src/visual.ts : (44,13) Type 'string | number | boolean | Date | Fill | FillRule | ISemanticFilter | DefaultValueDefinition | I...' is not assignable to type 'boo&lt;BR /&gt;lean'.&lt;BR /&gt;Type 'string' is not assignable to type 'boolean'."&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have no idea what the issue could be, it says there is an error with the following line in my update function:&lt;/P&gt;&lt;P&gt;this.myVisualProp = options.dataViews[0].metadata.objects["myCustomObj"]["myprop"];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yet when I put in a debugger and tried&amp;nbsp;typeof(options.dataViews[0].metadata.objects["myCustomObj"]["myprop"]) in the console it returned "boolean". If I am doing something wrong please let me know, my full code is below: visual.ts, capabilities.json&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;module powerbi.extensibility.visual {

    export class Visual implements IVisual {
        private target: HTMLElement;
        private myVisualProp: boolean;

        constructor(options: VisualConstructorOptions) {
            var captionArea = document.createElement("div");
            captionArea.innerHTML = "This is a test chart";
            options.element.appendChild(captionArea);
            this.target = document.createElement("div");
            options.element.appendChild(this.target);

            this.myVisualProp = false;
        }

        public update(options: VisualUpdateOptions) {
            this.myVisualProp = options.dataViews[0].metadata.objects["myCustomObj"]["myprop"];
            this.target.innerHTML =
                "Custom Prop is " + this.myVisualProp;
                
        }

        public enumerateObjectInstances(options: EnumerateVisualObjectInstancesOptions): VisualObjectInstanceEnumeration {
            let objectName = options.objectName;
            let objectEnumeration: VisualObjectInstance[] = [];

            switch (objectName) {
                case 'myCustomObj':
                    objectEnumeration.push({
                        objectName: objectName,
                        properties: {
                            myprop: this.myVisualProp,
                        },
                        selector: null
                    });
                    break;
            };

            return objectEnumeration;
        }

        public destroy(): void {
            //TODO: perform any cleanup tasks here 
        }
    }
}&lt;/PRE&gt;&lt;PRE&gt;{
    "dataRoles": [
        {
            "displayName": "Category Data",
            "name": "category",
            "kind": "Grouping"
        },
        {
            "displayName": "Measure Data",
            "name": "measure",
            "kind": "Measure"
        },
        {
            "displayName": "Grouping",
            "name": "myGroup",
            "kind": "Grouping"
        }
    ],
    "dataViewMappings": [
        {
            "table": {
                "rows": {
                    "select": [
                        {"for": {"in": "myCategory"}},
                        {"for": {"in": "measure"}}
                    ]
                }
            }
        }
    ],
    "objects": {
    "myCustomObj": {
      "displayName": "Test Object",
      "properties": {
        "myprop": {
          "displayName": "Test Property",
          "type": { "bool": true }
                }
            }
        }
    }
}&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Nov 2016 03:00:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-object-boolean-problem/m-p/95005#M3386</guid>
      <dc:creator>TPreece</dc:creator>
      <dc:date>2016-11-29T03:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Custom object boolean problem</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Custom-object-boolean-problem/m-p/96343#M3404</link>
      <description>&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/17566"&gt;@TPreece﻿&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may add&amp;nbsp;&lt;A href="https://www.typescriptlang.org/docs/handbook/basic-types.html#type-assertions" target="_self"&gt;Type assertions&lt;/A&gt; to workaround this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2016 11:39:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Custom-object-boolean-problem/m-p/96343#M3404</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2016-12-01T11:39:50Z</dc:date>
    </item>
  </channel>
</rss>

