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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
StevenVF
Helper I
Helper I

Web.Content and Relative path adding a full stop to the url

Hi All

 

Hoping someone can help me. I'm tring to download some JSON files from a Sharepoint folder and then combine them into a table output.

 

I have successfully been able to do this however when i try and publish it in a dataflow i get the "cannot reference a dynamic table" error because i'm using a combination of web.contents and a function to get the filename. This code works in the Power Query editor but i can't publish it in the Power BI service as mentioned:

(file as text) => 

Source = Json.Document(
Web.Contents("https://################/sites/Reporting-RPA/Shared Documents/BB Sales Reports/"&(file)) 

 

I read a solution to this is to use the RelativePath arguement in web.contents to reference the changing file name like so:

(file as text) => 

Source = Json.Document(
Web.Contents("https://################/sites/Reporting-RPA/Shared Documents/BB Sales Reports/",
[RelativePath = (file)]
) 

 

The new problem i have when using relativepath is it is adding a fullstop to the end of the URL like so

The credentials provided for the Web source are invalid, (Source at https://#############/sites/Reporting-RPA/Shared%20Documents/BB%20Sales%20Reports/ConsumerFAB-221120220443.txt.)

You can see after the .txt there is and additional "."

It does not matter if i use a hard coded value in the relativepath arguement or a dynamic value, it's the same result, and additional fullstop.

 

Can anyone explain why it's doing this and how to fix it?

Thanks in advance

1 ACCEPTED SOLUTION
StevenVF
Helper I
Helper I

I could not figure out the variablepath issue so i've just switch to the sharepointfile connector where i'm able to do what i need. Thanks again.

View solution in original post

3 REPLIES 3
StevenVF
Helper I
Helper I

I could not figure out the variablepath issue so i've just switch to the sharepointfile connector where i'm able to do what i need. Thanks again.

ams1
Responsive Resident
Responsive Resident

Hi,

 

I'm 100% sure (but that's MY opinion 😊) that the dot "." at the end of the url is added automatically in the error message -> RelativePath does NOT automatically add a dot.

 

RelativePath is not the problem -> I think you should concentrate first on fixing "The credentials provided for the Web source are invalid".

 

There should be plenty resources out there regarding "The credentials provided for the Web source are invalid", ex.:

https://community.powerbi.com/t5/Service/The-credentials-provided-for-the-Web-source-are-invalid/m-p...

(at the end of the above link there is also an error message with a . at the end).

 

If you cannot fix the credentials problem, I think you should open another question regarding that problem - your choice.

 

Please mark as answer this post if it helps.

Hi there

 

I appreciate the reply.

 

That could be correct the bracket after it threw me off hence why i thought it belonged to the URL.


If i don't use the variable path and just add &(file) which i my parameter for the filename, it works fine no authentification issues. If i use the variable path to avoid the dynamic table refresh issue then it will not authenticate. Also if i hard code the the full file url it authenticates too, the credintials are fine which leads me to believe the issue is that it is not passing the corrent url and that's why it failing on authication. I'm not and expert haha, but i can't understand this behaviour. 

This problem only occurs when i use the variable path, even if i don't use a parameter at all and hard code the variable path.

 

Personally i can't understand why if power query can do the transformations, why does the service complaint about a vaiable table....

 

Any other help or suggestion are greatly appreciated

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Top Solution Authors