Forum Discussion
Data refresh not working : OK on desktop, NOK on Service - 'dynamic data sources'
- 1 year ago
I eventually found the cause why I still got the dynamic source error:
in the code above I simplified the code as
baseurl = "https://X.Y.Z/soap/3/orga_test"
But in reality baseURL was calculated based on a boolean 'useTestURL', which then choose between 2 parameters: the prodURL and the testURL.
So, the baseURL used in the web.Contents was indeed dynamic.
The solutions was: since test and prod have the same bare URI, I've split that part into a seperate parameter which is fixed. And the test/prod is now inserted are part of the relativePath.
baseurl = "https://X.Y.Z/soap/3/"
relPath = if useTest then testRelPath else prodRelPath
apiEndPoint = "getObjects"
cnt = Text.ToBinary("Some SOAP XML")
and then calling
Web.Contents(baseurl, [RelativePath=relPath & "/" & apiEndPoint, Content=cnt])
So stupid
You need to hide/mask your dynamic query parts.
Please follow the documentation. Use RelativePath and Query parameters. https://learn.microsoft.com/en-us/powerquery-m/web-contents#example-1
And yes, queries that are set to "don't include in Refresh" may still be included (ignoring your request) if they are part of the lineage.
Thanks for the link... but I don't see what I'm doing wrong using when defining:
baseurl = "https://X.Y.Z/soap/3/orga_test"
apiEndPoint = "getObjects"
cnt = Text.ToBinary("Some SOAP XML")
and then calling
Web.Contents(baseurl, [RelativePath=apiEndPoint, Content=cnt])
as far as I can read, I follow the rules, no?
Or does that imply I can not use 'manually written tables' inside a query to define a configuration? Because those are not loeded into the modelling, but are obviously linked by the query dependencies.
Forgive my ignorance.
- lbendlin1 year ago
Super User
Or does that imply I can not use 'manually written tables' inside a query to define a configuration?Very likely but hard to tell without seeing the code.
- cdebackere1 year ago
Resolver I
maybe a screenshot of those 'config table' definitions which are manually written:
- lbendlin1 year ago
Super User
yes, if you expect to be able to run custom queries against these "tables" (columns) in your query - that will never work in the service. Power Query does not allow a dynamic number of queries. At a minimum you need to have all possible queries present as shells. And even then - when these shells produce different results across refreshes (regarding number of columns , names and types) you will get another error that the meta data doesn't match.
- cdebackere1 year ago
Resolver I
the three config tables are 'Enter data' tables in power query.
This is one of them:
let
Bron = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("pZTbbsIwDIbfhespmrTHQbswqVvCnLhyHCTefiG0a9qlDGkSF/j85bfheDwMGFCAjDolPLz9shuu/9pg1V2d3ozeRjQB/DSHcADCoPdQPLNoCX2+HQ/C7E1I/oSS80aUyGEuFBPT6YJW83fLSeKjpSEOw+IahNPYCkRNXZ4ZUVfRmRksdOidNTeE+2ybRJxNlDxd6cMsZlu6iv5BO7GjB0c1/IaqoBQNpj47RGaEkrLB6rK+0XHIxvtPg4XFgh9TzK6o0PfrR6zFnXAsB81bM+e7+USdv/yrSVspKUUt+23jVglzuy+UoAi+COlCzybaM3aJStbE/hLjrOPT4M6pVGfbhFccWKbQhEl547zHuGXBIEyEnQHPKajh/udoX86q0FWgHJzg4Dy21dw+4pQcda689vGZ76J1/v90ju5CzTOY3pAVHcHWYu9VLhHX/e4X1+PXBUvIjMKDgM/7voI4CNoaUP/ka+Y+hfxnx2ErnOcOaV5Fvg4TyVmsO6+bbetzVdzJ/vwG", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [rooms = _t, person.staff = _t, reservation = _t, course = _t, course.group = _t, course.studentset = _t, studentset = _t, curriculumlvl3 = _t, activity.type = _t, bookings.type = _t, legalentity = _t]),
#"Type gewijzigd" = Table.TransformColumnTypes(Bron,{{"rooms", type text}, {"person.staff", type text}, {"reservation", type text}})
in
#"Type gewijzigd" - cdebackere1 year ago
Resolver I
I replied with the code 2 times. The reply is there, and then when I check later the reply is gone. Something deletes my reply.
Is code not allowed?