Hi,
I am trying to import a raw text file from a repo I have in bitbucket into power bi, but I get a file note found. Once I import this file, I want to evaluate the query ( I know how to do this) but I can't get access to the text file.
Can anyone tell me what syntax I need?
let
// Define the URL of the API endpoint
url = "https://bitbucket.org/broadspectrum/bustthetape/raw/7f104785464107f192272d47c30cf2766c57ea13/70061.txt",
// Set up the HTTP headers to include the Bearer token
headers = [
#"Authorization"="Authorization: Bearer Token"
],
// Get HTML content from the API
Source = Text.FromBinary(Web.Contents(url, [Headers=headers])),
// Example of parsing HTML content:
// This is a simplistic example where we look for a specific tag or pattern.
// This will need to be adjusted based on the actual HTML structure you're dealing with.
startIndex = Text.PositionOf(Source, "<tag>"),
endIndex = Text.PositionOf(Source, "</tag>"),
extractedValue = Text.Middle(Source, startIndex, endIndex - startIndex + 5) // Adjust length based on tags
// More complex parsing might be needed based on the HTML structure
// You might also need to split the text, extract parts using Text.BetweenDelimiters, etc.
in
extractedValue