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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
elaine1217
Helper I
Helper I

Scheduled Refresh - Dynamic Data Source Microsoft Lists

I am using a query that imports all the versions of each item in a Microsoft List. When I publish the dashbaord to PowerBI it doesn't allow me to set up scheduled refreshes. Based on similar questions, I think this has to do with the Web.Contents statement, but I've updated to use relative path and it still is giving me issues. I also couldn't figure out the query parameter to past the item number and list name to the web.contents statement. Query is below. Thanks!

 

let
Source = (VersionsRelevantSharePointListName as text, VersionsRelevantSharePointLocation as text, VersionsRelevantItemID as number) => let
Source = Xml.Tables(Web.Contents(VersionsRelevantSharePointLocation, [RelativePath= Text.Combine({"/_api/web/Lists/getbytitle('", VersionsRelevantSharePointListName ,
"')/items(", Text.From(VersionsRelevantItemID), ")/versions"})])
),
entry = Source{0}[entry],
#"Removed Other Columns2" = Table.SelectColumns(entry,{"content"}),
#"Expanded content" = Table.ExpandTableColumn(#"Removed Other Columns2", "content", {"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"}, {"content"}),
#"Expanded content1" = Table.ExpandTableColumn(#"Expanded content", "content", {"properties"}, {"properties"}),
#"Expanded properties" = Table.ExpandTableColumn(#"Expanded content1", "properties", {"http://schemas.microsoft.com/ado/2007/08/dataservices"}, {"properties"})
in
#"Expanded properties"
in
Source

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @elaine1217 ,

 

You need to fix the SharePoint site link and then you will be able to refresh it successfully.

 

let
Source = ( VersionsRelevantSharePointListName as text, VersionsRelevantItemID as number) => let
Source = Xml.Tables(Web.Contents("https://xxxxx.sharepoint.com/sites/winniz-test", [RelativePath= Text.Combine({"/_api/web/Lists/getbytitle('", VersionsRelevantSharePointListName ,
"')/items(", Text.From(VersionsRelevantItemID), ")/versions"})])
),
entry = Source{0}[entry],
#"Removed Other Columns2" = Table.SelectColumns(entry,{"content"}),
#"Expanded content" = Table.ExpandTableColumn(#"Removed Other Columns2", "content", {"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"}, {"content"}),
#"Expanded content1" = Table.ExpandTableColumn(#"Expanded content", "content", {"properties"}, {"properties"}),
#"Expanded properties" = Table.ExpandTableColumn(#"Expanded content1", "properties", {"http://schemas.microsoft.com/ado/2007/08/dataservices"}, {"properties"})
in
#"Expanded properties"
in
Source

winniz_0-1660038043699.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-kkf-msft
Community Support
Community Support

Hi @elaine1217 ,

 

Has your problem been solved? If it is solved, please mark a reply which is helpful to you.

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.


Best Regards,
Winniz

Anonymous
Not applicable

Hi @elaine1217 ,

 

You need to fix the SharePoint site link and then you will be able to refresh it successfully.

 

let
Source = ( VersionsRelevantSharePointListName as text, VersionsRelevantItemID as number) => let
Source = Xml.Tables(Web.Contents("https://xxxxx.sharepoint.com/sites/winniz-test", [RelativePath= Text.Combine({"/_api/web/Lists/getbytitle('", VersionsRelevantSharePointListName ,
"')/items(", Text.From(VersionsRelevantItemID), ")/versions"})])
),
entry = Source{0}[entry],
#"Removed Other Columns2" = Table.SelectColumns(entry,{"content"}),
#"Expanded content" = Table.ExpandTableColumn(#"Removed Other Columns2", "content", {"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"}, {"content"}),
#"Expanded content1" = Table.ExpandTableColumn(#"Expanded content", "content", {"properties"}, {"properties"}),
#"Expanded properties" = Table.ExpandTableColumn(#"Expanded content1", "properties", {"http://schemas.microsoft.com/ado/2007/08/dataservices"}, {"properties"})
in
#"Expanded properties"
in
Source

winniz_0-1660038043699.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks! That worked for me

ImkeF
Community Champion
Community Champion

Hi @elaine1217 ,
you can either use a tool like Fiddler to record the queries that have been sent by these 2 approaches and compare the URLs or debug your current query like so:
Check the string in step "RelativePathURL"

let
  VersionsRelevantSharePointListName = "xxxx", 
  VersionsRelevantSharePointLocation = "yyyyy", 
  VersionsRelevantItemID = "zzz", 
  RelativePathURL = Text.Combine(
    {
      "/_api/web/Lists/getbytitle('", 
      VersionsRelevantSharePointListName, 
      "')/items(", 
      Text.From(VersionsRelevantItemID), 
      ")/versions"
    }
  ), 
  Source = Xml.Tables(
    Web.Contents(VersionsRelevantSharePointLocation, [RelativePath = RelativePathURL])
  ), 
  entry = Source{0}[entry], 
  #"Removed Other Columns2" = Table.SelectColumns(entry, {"content"}), 
  #"Expanded content" = Table.ExpandTableColumn(
    #"Removed Other Columns2", 
    "content", 
    {"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"}, 
    {"content"}
  ), 
  #"Expanded content1" = Table.ExpandTableColumn(
    #"Expanded content", 
    "content", 
    {"properties"}, 
    {"properties"}
  ), 
  #"Expanded properties" = Table.ExpandTableColumn(
    #"Expanded content1", 
    "properties", 
    {"http://schemas.microsoft.com/ado/2007/08/dataservices"}, 
    {"properties"}
  )
in
  #"Expanded properties"

Otherwise, posting your error-message here might help as well.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

elaine1217
Helper I
Helper I

Hi @ImkeF 

 

This is what the finished url would look like. I've tried it with my site name and list name and it works in this format:

 

https://sharepoint.com/sites/MySite/_api/web/Lists/getbytitle('My list name')/items(20)/versions 

ImkeF
Community Champion
Community Champion

Hello @elaine1217 ,
not completely sure what statement your API actually expects.
Are you able to provide a sample URL that works for your use case? I could then show you how to parametrize correctly. This is really important, as the small details like quotes and brackets can make all the difference here.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors