Forum Discussion

chriswragge's avatar
chriswragge
Helper I
7 years ago
Solved

Using PowerBI Parameters Names in .txt files, to build dynamic API queries

Hi there,   I have a query that uses the PowerBI 'Web' source to pull reporting data from an API (POST method). I also have the client ID, client secrect, body, and token into seperate .txt files ...
  • Nishantjain's avatar
    Nishantjain
    7 years ago

    I just worked it out myself using the same exact logic. You can use this in a function too. Glad you were able to get this working

     

    let
    Source = (samplebinary as binary) =>
    let
    Source = samplebinary,
    ConvertToText= Text.FromBinary(Source,1252),
    ReplaceParam1 = Text.Replace(ConvertToText,"var1", param1),
    ReplaceParam2 = Text.Replace(ReplaceParam1 ,"var2", param2)
    in
    ReplaceParam2
    in
    Source