<?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: How can I get RolesIndex from the API? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-can-I-get-RolesIndex-from-the-API/m-p/1672649#M27910</link>
    <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I would say that if you want a supported way to do this, then it's probably better to &lt;A href="https://github.com/microsoft/powerbi-visuals-api/issues" target="_self"&gt;make a request in the repo for the feature&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;A hacky workaround would be to refer to it explicitly like this, but it's going to get resolved as an &lt;FONT face="courier new,courier"&gt;any&lt;/FONT&gt; type, and you may need to write some safety checks around the object properties in the chain, otherwise your visual will potential experience some unintended side-effects:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;dataViews[0].metadata.columns[i]['roleIndex']['statusImg'][0]&lt;/LI-CODE&gt;
&lt;P&gt;It might be worth stepping back to see if this is absolutely the way to solve what you are trying to do though - perhaps if you can share enough info and code around what you are trying to achieve, along with some sample data then perhaps we can take a look at a more supported approach?&lt;/P&gt;
&lt;P&gt;Ragards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2021 20:02:48 GMT</pubDate>
    <dc:creator>dm-p</dc:creator>
    <dc:date>2021-02-17T20:02:48Z</dc:date>
    <item>
      <title>How can I get RolesIndex from the API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-can-I-get-RolesIndex-from-the-API/m-p/1669496#M27877</link>
      <description>&lt;P&gt;Hi there, when there are multiple columns mapped in the same fields panel,&amp;nbsp; like that&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielAlmeida_0-1613484979870.png" style="width: 139px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/455821iFEA23A12F0916F5B/image-dimensions/139x63?v=v2" width="139" height="63" role="button" title="gabrielAlmeida_0-1613484979870.png" alt="gabrielAlmeida_0-1613484979870.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;in the metadata -&amp;gt; columns -&amp;gt; rolesIndex&amp;nbsp; a vector is created containing the index of each field&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielAlmeida_1-1613485129097.png" style="width: 257px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/455824i7C7700BA6EA718A7/image-dimensions/257x131?v=v2" width="257" height="131" role="button" title="gabrielAlmeida_1-1613485129097.png" alt="gabrielAlmeida_1-1613485129097.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="gabrielAlmeida_2-1613485151979.png" style="width: 400px;"&gt;&lt;img src="https://community.fabric.microsoft.com/t5/image/serverpage/image-id/455825i3C72B1B4DDE61836/image-size/medium?v=v2&amp;amp;px=400" role="button" title="gabrielAlmeida_2-1613485151979.png" alt="gabrielAlmeida_2-1613485151979.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;But in the interface of the API this not acessible. I checked the DataViewUtils (&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/visuals/utils-dataview" target="_blank" rel="noopener"&gt;Introduction to use Data view utils in Power BI visual in Power BI embedded analytics for better embedded BI insights - Power BI | Microsoft Docs&lt;/A&gt;) , but its just help to find the specific role in different fields.&lt;BR /&gt;&lt;BR /&gt;How i get that specific property named rolesIndex in my code?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;&lt;P&gt;Gabriel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Feb 2021 14:25:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-can-I-get-RolesIndex-from-the-API/m-p/1669496#M27877</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-02-16T14:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can I get RolesIndex from the API?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-can-I-get-RolesIndex-from-the-API/m-p/1672649#M27910</link>
      <description>&lt;P&gt;Hi @Anonymous&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;I would say that if you want a supported way to do this, then it's probably better to &lt;A href="https://github.com/microsoft/powerbi-visuals-api/issues" target="_self"&gt;make a request in the repo for the feature&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;A hacky workaround would be to refer to it explicitly like this, but it's going to get resolved as an &lt;FONT face="courier new,courier"&gt;any&lt;/FONT&gt; type, and you may need to write some safety checks around the object properties in the chain, otherwise your visual will potential experience some unintended side-effects:&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;dataViews[0].metadata.columns[i]['roleIndex']['statusImg'][0]&lt;/LI-CODE&gt;
&lt;P&gt;It might be worth stepping back to see if this is absolutely the way to solve what you are trying to do though - perhaps if you can share enough info and code around what you are trying to achieve, along with some sample data then perhaps we can take a look at a more supported approach?&lt;/P&gt;
&lt;P&gt;Ragards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2021 20:02:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-can-I-get-RolesIndex-from-the-API/m-p/1672649#M27910</guid>
      <dc:creator>dm-p</dc:creator>
      <dc:date>2021-02-17T20:02:48Z</dc:date>
    </item>
  </channel>
</rss>

