Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
We need to get tables from several web pages that are numbered, so we have a function with a parameter named PageNumber, like so:
= (PageNumber as text)=>
let
Source = Web.BrowserContents("https://myDomain.com/?page="&PageNumber&"®ion=...
Now, we stored the original URL, the one with ".../?page =1& region=..." in a parameter, so we can change it, if needed.
To use this URL parameter inside the function, we insert the function's parameter name in the URL string, like so:
Text.Replace(#"URL","?page=1","?page=""&PageStart&""")
We end up with a string that is exactly the same as the one in the function's Source above.
We want to use this string with Web.BrowserContents in the function, but it gives us a
"DataSource.Error: Invalid URI: The URI scheme is not valid"
error, even though the string is the same as the one we paste in there.
How can we use a parameter to store the original URL and modifiy it to be used inside the custom function?
Thanks
In your function, you have an M expression that will dynamically concatenate the URL with the page number.
Your second example is generating a text value. It's not an M expression, and thus won't be dynamically evaluated.
To illustrate the difference, try evaluating the following two expressions in the formula bar of a blank query:
= 1 + 1
vs.
= "1 + 1"
These may look the same, but they're actually completely different. The first one is an addition expression. The second one is a text value that contains the text of an M addition expression.
Well, I would just respectfully advise that you are playing with fire by adding quotes into your text parameters. I understand why you are doing it--to unquote and then requote the url so you can add the parameter to the string.
Instead, put the quotes at the Web.Contents level, where your text parameters can always be entered as "https://www.url.com/?page="&StartPage&""®ion="®ionParam&"/"
Since you are using Text.Replace to get your url parameter, you should just get the Text.BeforeDelimiter, and use "?page=" as your delimiter.
Know what I'm saying?
--Nate
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Check out the July 2026 Power BI update to learn about new features.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 6 | |
| 5 | |
| 3 | |
| 3 | |
| 2 |