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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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