0

I have a powerapps-tile in my power bi Dashboard. In this powerapps tile i can request data from a REST-API. Now I want to live-visualize the data in the power bi dashboard.

Are there any good and simple way to get this done? Is it a good idea to parse the json data into a collection? How can I transfer the data to the power bi Dashboard?

Notice: The reason, why i want to use the Powerapps-tile is so that the user can send a custom API call with specific parameters.

Thanks in advance!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

2 Answers2

0

You might try calling the API and parsing the JSON directly in PowerBI.

Something like:

    let
    url = "https://company.com/api/path",
    headers = [
        "apikey" = thisisnotreallymyapikey
        "accept" = application/json,
        "Content-Type" = application/json
    ],
    content = "{
        ""key"": {
            ""nestedKey"": value1,
            ""nestedKey"": value2
        },
        ""key"": """",
        ""key"": ""value3"",
        ""key"": ""value4"",
        ""key"": value5,
        ""key"": [
            {""key1"": ""value6"", ""key2"": ""value7""}
        ]
    }",
    webdata = Web.Contents(url, [Headers=headers,Content = Text.ToBinary(content)]),
    response = Json.Document(webdata)
in
    response

Here is a forum post on POST'ing to an API that might give further guidance as well.

SeaDude
  • 3,725
  • 6
  • 31
  • 68
  • Thank you for your answer! It is important, that the request is sent from the powerapps-tile, so that the user can send a custom request with specific parameters. From Power BI the user can't edit the request. – DrJohnWatson Jul 21 '19 at 18:41
0

@DrJohnWatson, thanks for the clarification.

You might instead try:

  1. User inputs custom parameters using PowerApps-tile in PowerBI
  2. User clicks "Submit" and kicks off a Flow with HTTP Request which passes the parameters to the API and receives the response
  3. Use the Add a Row to Power BI Dataset Action to visualize the data in Power BI

enter image description here

SeaDude
  • 3,725
  • 6
  • 31
  • 68