Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

undefinedA relative URI cannot be created because the 'uriString' parameter represents an absolute U

Hi All,

 

I need a help with a Power Query error. Below is the Power Query where I have a parameter and get data from a Web connection using that parameter value. But this is giving me the following error:

A relative URI cannot be created because the 'uriString' parameter represents an absolute URI

Power Query:

let

Custom1 = Text.Replace(#"EnrollmentID or BillingAccountID",":","__"),
FilePath = "Folder1/"&Custom1&"/Folder2/File1",
PathEncode = Uri.EscapeDataString(FilePath) ,
RelPath = #"EnrollmentID or BillingAccountID" & "/" & PathEncode,
Custom2 = Csv.Document(Web.Contents("https://abc.powerapps.com/customerenroll/data", [RelativePath=RelPath]),[Delimiter=",", Columns=13, Encoding=65001, QuoteStyle=QuoteStyle.None]),

#"Promoted Headers" = Table.PromoteHeaders(Custom2, [PromoteAllScalars=false])

in
#"Promoted Headers"

 

I couldn't understand why this error is coming up as the same Power Query is working fine with our test Web url. Can someone help me identify/fix this issue?

 

Thanks

Lakshmi Koduri

3 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Garrysfarrell 

    No, should be part of the common URL and only the #"EnrollmentID or BillingAccountID" & "/" & PathEncode part of the URL should be in Relative path as its dynamic. That's how our Service API is built. If I use "/customerenroll/data" in Relative path, the OAuth authentication itself will not be supported to connect and get contents from the API. I have tested this way and it didn't work.

     

  • v-jingzhang's avatar
    v-jingzhang
    Community Support

    Hi Anonymous 

     

    What does #"EnrollmentID or BillingAccountID" refer to? Is it a step in another query and its result is a text string?

     

    If you use RelPath to replace #"Promoted Headers" after "in" statement, does it return the correct RelPath value? Because in your Custom1 step, you replace ":" with "__" in #"EnrollmentID or BillingAccountID", but in RelPath = #"EnrollmentID or BillingAccountID" & "/" & PathEncode step, you use #"EnrollmentID or BillingAccountID" again and it still has ":" in it. I think this shouldn't be included in the URI, this may be the cause.

     

    You need to ensure RelPath returns the correct value in the correct format first.

     

    Regards,
    Community Support Team _ Jing
    If this post helps, please Accept it as the solution to help other members find it.