<?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 How to pass parameters to the SQL statement from the embedded app? in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/How-to-pass-parameters-to-the-SQL-statement-from-the-embedded/m-p/908344#M22078</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to the PBI services so my question might be a bit silly but I'm a bit lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TLDR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is it possible to pass parameter to the SQL query from the app over the PBI API to display the report? What would be the best way to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current stack&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the PBI Desktop we have reports and the SQL queries are sitting there.&lt;/LI&gt;&lt;LI&gt;The published reports are in the PBI services in a Workspace.&lt;/LI&gt;&lt;LI&gt;We have a single page application with it's own login and role system where we'd like to display the reports.&lt;/LI&gt;&lt;LI&gt;We also have an API (in Azure Funtions) what get's all the embedTokens and embedLinks for the reports in a specific group from the PBI services.&lt;/LI&gt;&lt;LI&gt;Until this point everything works fine however the report contains everybody's data.&lt;/LI&gt;&lt;LI&gt;So I'm wondering would it be possible to pass a param to the SQL query from the app to update the report?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Goal&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When the user logs in the app knows the group ID he belongs to. The displayed report should be based on that specific ID and the user should not be able to see any other results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I imagined something like:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Somehow passing params to the PBI API:&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}?myId=123" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}?myId=123&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;The report runs the SQL query with the passed param and the embedded report would update.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This might be not the best approach but how could we achieve that? Is it even possible to dynamically update the SQL query from the app/API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if not, how could I display the data based on the user's role?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jan 2020 18:08:55 GMT</pubDate>
    <dc:creator>daviidkovacs</dc:creator>
    <dc:date>2020-01-22T18:08:55Z</dc:date>
    <item>
      <title>How to pass parameters to the SQL statement from the embedded app?</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/How-to-pass-parameters-to-the-SQL-statement-from-the-embedded/m-p/908344#M22078</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to the PBI services so my question might be a bit silly but I'm a bit lost.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;TLDR&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Is it possible to pass parameter to the SQL query from the app over the PBI API to display the report? What would be the best way to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Current stack&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;In the PBI Desktop we have reports and the SQL queries are sitting there.&lt;/LI&gt;&lt;LI&gt;The published reports are in the PBI services in a Workspace.&lt;/LI&gt;&lt;LI&gt;We have a single page application with it's own login and role system where we'd like to display the reports.&lt;/LI&gt;&lt;LI&gt;We also have an API (in Azure Funtions) what get's all the embedTokens and embedLinks for the reports in a specific group from the PBI services.&lt;/LI&gt;&lt;LI&gt;Until this point everything works fine however the report contains everybody's data.&lt;/LI&gt;&lt;LI&gt;So I'm wondering would it be possible to pass a param to the SQL query from the app to update the report?&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;Goal&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;When the user logs in the app knows the group ID he belongs to. The displayed report should be based on that specific ID and the user should not be able to see any other results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I imagined something like:&lt;/STRONG&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Somehow passing params to the PBI API:&lt;BR /&gt;&lt;EM&gt;&lt;A href="https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}?myId=123" target="_blank" rel="noopener"&gt;https://api.powerbi.com/v1.0/myorg/groups/{groupId}/reports/{reportId}?myId=123&lt;/A&gt;&lt;/EM&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;DIV&gt;&lt;UL&gt;&lt;LI&gt;The report runs the SQL query with the passed param and the embedded report would update.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This might be not the best approach but how could we achieve that? Is it even possible to dynamically update the SQL query from the app/API?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if not, how could I display the data based on the user's role?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;David&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jan 2020 18:08:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/How-to-pass-parameters-to-the-SQL-statement-from-the-embedded/m-p/908344#M22078</guid>
      <dc:creator>daviidkovacs</dc:creator>
      <dc:date>2020-01-22T18:08:55Z</dc:date>
    </item>
  </channel>
</rss>

