<?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 Re: Accessing data through names defined in capabilities.json in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Accessing-data-through-names-defined-in-capabilities-json/m-p/229976#M7246</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="36706" data-lia-user-login="callum" class="lia-mention lia-mention-user"&gt;callum&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may check "options.dataViews[0].table.columns[0].roles".&lt;/P&gt;</description>
    <pubDate>Fri, 11 Aug 2017 11:32:49 GMT</pubDate>
    <dc:creator>v-chuncz-msft</dc:creator>
    <dc:date>2017-08-11T11:32:49Z</dc:date>
    <item>
      <title>Accessing data through names defined in capabilities.json</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Accessing-data-through-names-defined-in-capabilities-json/m-p/229054#M7220</link>
      <description>&lt;P&gt;&amp;nbsp;I'll try to explain this the best I can.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I have the following capabilities.json file:&lt;/P&gt;&lt;PRE&gt;{
  "dataRoles": [
    {
      "displayName": "Test 1",
      "name": "test1",
      "kind": "Grouping"
    },
    {
      "displayName": "Test 2",
      "name": "test2",
      "kind": "Grouping"
    }
  ],
  "dataViewMappings": [
    {
      "table": {
        "rows": {
          "select": [
            {
              "for": {
                "in": "test1"
              }
            },
            {
              "for": {
                "in": "test2"
              }
            }
          ]
        }
      }
    }
  ]
}&lt;/PRE&gt;&lt;P&gt;and in my dataset I have columns "foo" and "bar", then on my custom visual I can drag the foo column into the "Test 1" field, and the bar column into the "Test 2" field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I view the resulting dataset with console.log(options.dataViews[0].table), I don't see any mention of the words test1 and test2, only foo and bar... But these names are defined by the user, so they aren't much use to me!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;At first I thought the columns might be ordered in the way they're defined in capabilities.json, so for example the first test1 item would be at options.dataViews[0].table.rows[0][0] and the first test2 item would be at options.dataViews[0].table.rows[0][1]... but there doesn't actually appear to be any particular order to the columns, so I can't rely on that method.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I'm not being clear here, the following question is pretty much equivalent: how would I loop through every row in the table and output only the values corresponding to test1?&lt;/P&gt;</description>
      <pubDate>Thu, 10 Aug 2017 09:04:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Accessing-data-through-names-defined-in-capabilities-json/m-p/229054#M7220</guid>
      <dc:creator>callum</dc:creator>
      <dc:date>2017-08-10T09:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing data through names defined in capabilities.json</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Accessing-data-through-names-defined-in-capabilities-json/m-p/229976#M7246</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="36706" data-lia-user-login="callum" class="lia-mention lia-mention-user"&gt;callum&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may check "options.dataViews[0].table.columns[0].roles".&lt;/P&gt;</description>
      <pubDate>Fri, 11 Aug 2017 11:32:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Accessing-data-through-names-defined-in-capabilities-json/m-p/229976#M7246</guid>
      <dc:creator>v-chuncz-msft</dc:creator>
      <dc:date>2017-08-11T11:32:49Z</dc:date>
    </item>
  </channel>
</rss>

