Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

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 3
v-jingzhang
Community Support
Community Support

Hi @Lakshmi_Koduri 

 

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.

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.

 

Garrysfarrell
Frequent Visitor

Hi, Should this "/customerenroll/data" part of URL be added to the relative path?

 

RelPath = "/customerenroll/data" & #"EnrollmentID or BillingAccountID" & "/" & PathEncode,

Custom2 = Csv.Document(Web.Contents("https://abc.powerapps.com", [RelativePath=RelPath]),

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors