Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
dumpydata
New Member

table data view mapping stops working when I try add to add conditions or requiredTypes

I am building a custom visual using api version 5.1.0 and I am losing my mind over this. I have read the documentation over and over and I feel like it should work. If i remove all the "conditions" and all the "requiredTypes" and "preferedTypes" it works. In some combinations it DOES work, but the road_number column is all set to null.
 
```json
"dataRoles": [
        {
            "displayName":"Road",
            "name":"road_number",
            "kind":"Grouping",
            "requiredTypes" : [{"text": true}],
            "preferredTypes": [{"text": true}]
        },
        {
            "displayName":"SLK From (km)",
            "name":"slk_from",
            "kind":"Grouping",
            "requiredTypes" : [{"numeric": true}],
            "preferredTypes": [{"numeric": true}]
        },
        {
            "displayName":"SLK To (km)",
            "name":"slk_to",
            "kind":"Grouping",
            "requiredTypes" : [{"numeric": true}],
            "preferredTypes": [{"numeric": true}]
        },
        {
            "displayName":"Carriageway",
            "name":"cwy",
            "kind":"Grouping",
            "requiredTypes" : [{"text": true}],
            "preferredTypes": [{"text": true}]
        },
        {
            "displayName":"Offset",
            "name":"offset",
            "kind":"Grouping",
            "requiredTypes" : [{"numeric": true}],
            "preferredTypes": [{"numeric": true}]
        }
        ,
        {
            "displayName":"Colour",
            "name":"colour",
            "kind":"Grouping",
            "requiredTypes" : [{"text": true}],
            "preferredTypes": [{"text": true}]
        }
],
"dataViewMappings": [
        {
           
           "conditions": [{
                    "road_number":{"max": 1, "min":1},
                    "slk_from":{"max": 1, "min":1},
                    "slk_to":{"max": 1, "min":1}
                }],
            "table": {
                "rows": {
                    "select": [
                        {"bind": {"to": "road_number"}},
                        {"bind": {"to": "cwy"}},
                        {"bind": {"to": "slk_from"}},
                        {"bind": {"to": "slk_to"}},
                        {"bind": {"to": "offset"}},
                        {"bind": {"to": "colour"}}
                    ]
                }
            }
        }
    ],
 
```
 
Depending on the constraints I remove, the visual sometimes fails to call the "update" function, or the "update" function is called, but on inspecting the dataview I see:
 
```json
"rows": [
                [
                    0, <--slk_from is numeric and works fine
                    2, <-- slk_to is also fine
                    {}  <-- I expect text here like "H015"... but when i read it in javascript this is null
                ],
                [
                    3,
                    5,
                    {}
                ],
                [
                    4,
                    7,
                    {}
                ],
                [
                    4,
                    8,
                    {}
                ]
            ]
```
This makes no sense as I have carefully verified that all my test data is valid and all constraints are met.
Please, any help or hints would be very much appreciated 🙂
0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors