In my capabilities.json, I have data roles defined like this:
"dataRoles": [ {"displayName": "Measured Depth", "name": "measuredDepth", "kind": "Grouping"}, {"displayName": "Is Planned", "name": "isPlanned", "kind": "Grouping"}, {"displayName": "Is Actual", "name": "isActual", "kind": "Grouping"}, {"displayName": "Depth Above", "name": "depthAbove", "kind": "Grouping"}, {"displayName": "Planned TVD", "name": "plannedTrueVerticalDepth", "kind": "Grouping"}, {"displayName": "Depth Below", "name": "depthBelow", "kind": "Grouping"}, {"displayName": "Actual TVD", "name": "actualTrueVerticalDepth", "kind": "Grouping"}, {"displayName": "Dog Leg Severity", "name": "dogLegSeverity", "kind": "Grouping"} ]
And my data view mapping looks like this:
"dataViewMappings": [{ "table": {"rows": { "select": [ {"for": {"in": "measuredDepth"}}, {"for": {"in": "isPlanned"}}, {"for": {"in": "isActual"}}, {"for": {"in": "depthAbove"}}, {"for": {"in": "plannedTrueVerticalDepth"}}, {"for": {"in": "depthBelow"}}, {"for": {"in": "actualTrueVerticalDepth"}}, {"for": {"in": "dogLegSeverity"}} ]}} }]
And yet, when I look at my row data in the javascript debugger, the columns do not come in that order (abbreviated):
{ "0": {"roles": {"isActual": true}}, "1": {"roles": {"isPlanned": true}}, "2": {"roles": {"depthAbove": true}}, "3": {"roles": {"plannedTrueVerticalDepth": true}}, "4": {"roles": {"depthBelow": true}}, "5": {"roles": {"actualTrueVerticalDepth": true}}, "6": {"roles": {"dogLegSeverity": true}}, "7": {"roles": {"measuredDepth": true}} }
Is this normal, or did I set something up wrong? Do I need to scan the columns and dynamically locate my data points on each refresh? I sort of thought the data view mapping would handle that.