Forum Discussion
chriswragge
7 years agoHelper I
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 ...
- 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
Nishantjain
7 years agoContinued Contributor
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
chriswragge
7 years agoHelper I
Thanks Nishantjain. Accepting your post as the solution as it put me in the right direction and answers the question.
Appreciate all the help!!