Classic file types are no longer available for use as of January 2021. You can transition your classic files or download a PDF. Learn More

Script to Pull Report into PowerBI

2

Comments

3 comments

  • Isabel Messore

    Amazing Danielle Okland, thank you for sharing this!

     

    0
  • Chris Omland

    This is great! Thank you for taking the time to share.

    0
  • Sander van Duinen

    I would like to echo the others and say: Amazing stuff Danielle! Thanks for taking the time to share :-)

    Second, I wanted to build upon Danielle's awesome work to make Workiva API's even more approachable. Specifically: the code snippet above assumes the API response is text/csv (through adding the header 'Accept = "text/csv"'). However, in a recent case of mine the response came over in JSON regardless. In these cases, the response can parsed in PowerBi as presented below. 

    response = Json.Document(Web.Contents(url, [Headers=api_headers])),
    data = response[data],

       // Convert the response to a table
    #"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"responseProperty1", "responseProperty2"}, {"RenameResponseProperty1", "RenameResponseProperty2"})

    // Note that Workiva API's can return lists/records that require further expansion in PowerBi. This can be achieved through the Power Query Editor.

    in

        #"Expanded Column1"
    1

Please sign in to leave a comment.