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 🙂