Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I saw some postings on this similar error but I don't understand how to write the MQuery for api that I have set up in my reports. Can someone help me with the appropriate MQuery to be able to do a refresh in services to reports that are getting called from this format below:
Json.Document(Web.Contents("https://name.name.com:1111/api/viewContents/projects/v1/PowerBiAllProjects?projectId=-1"))
Solved! Go to Solution.
I was able to import and also get the Gateway refresh to work now. I had to split it up this way:
= Json.Document(
Web.Contents("https://name.com:port",
[
RelativePath="/api/viewContents/projects/v1/PowerBiProjects?projectId=-1"
]
)
)
Hi, We might help you more if you show us the error and specify the api authentication. Here is the good practise for this:
Web.Contents(
"https://name.name.com:1111/api",
[
RelativePath="viewContents/projects/v1/PowerBiAllProjects",
Query=[projectId=-1]
]
)
I hope this works.
Regards,
Happy to help!
That would not connect following your example. My error is this:
You can't schedule refresh for this dataset because the following data sources currently don't support refresh:
Query contains unsupported function. Function name: Web.Contents
Here is the data source for this from advanced editor:
Source = Json.Document(Web.Contents("https://name:port/api" & "/viewContents/projects/v1/PowerBiProjects?" & "projectId=-1")),
viewContentsV1 = Source[viewContentsV1],
rows = viewContentsV1[rows],
That data source is not well formatted. Refer to the example provided by @ibarrau
It may also help not to conflate the web request and the JSON parser.
Try having the source as just the web contents.
Source = Web.Contents(URL,Parameters),
JS = Json.Document(Source),
viewContentsV1 = JS[viewContentsV1],
rows = viewContentsV1[rows],
His format would not work - my import fails.
The format I have sent is the best practise. I might have some mistake somewhere. Try "-1" with double quotes in the parameter.
Regards,
Happy to help!
I was able to import and also get the Gateway refresh to work now. I had to split it up this way:
= Json.Document(
Web.Contents("https://name.com:port",
[
RelativePath="/api/viewContents/projects/v1/PowerBiProjects?projectId=-1"
]
)
)
Hard coding is not a good solution. You will want to follow @ibarrau 's guidelines.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 5 | |
| 5 | |
| 4 |