Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I keep getting error "Expression.Error: We cannot convert a value of type Record to type Function." using the code below?
let
BaseUrl = "https://someurl.com",
Since = #date(2018, 12, 10),
UnixSince = Number.ToText(Duration.TotalSeconds(Since-DateTime.Date(#datetime(1970, 1, 1, 0, 0, 0)))),
Source = Json.Document(Web.Contents(BaseUrl & "?since=" & UnixSince, [Headers=[#"X-User-Email"="Test.Email@.com", #"X-User-Token"="1111111111111111"]])),
metacode = Source[meta],
PageCount = metacode[total_pages],
GetJson = (Url) =>
let Options = [Headers=[#"X-User-Email"="Test.Email@.com", #"X-User-Token"="1111111111111111"]],
RawData = Web.Contents(Url, Options),
Json = Json.Document(RawData)
in Json,
GetPage = (Index) =>
let Page = "&page=" & Text.From(Index),
Url = BaseUrl & "?since=" & UnixSince & "&page=" & Page,
Json = Function.InvokeAfter(GetJson(Url), #duration(0,0,0,5)),
Value = Json[#"answers"]
in Value,
Indicies = { 1 .. PageCount},
Pages = List.Transform(Indicies, each GetPage(_)),
Entities = List.Union(Pages),
Table = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
Table
I'm at a loss why this is occurring and would appreciate any assistance.
Thanks in advance.
Solved! Go to Solution.
Hi @v-shex-msft,
You're correct, the query does require particular SSL credentials.
The step that causes the issue appeared to be "Table = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error)".
After testing it actually turned out to be "Json = Function.InvokeAfter(GetJson(Url), #duration(0,0,0,5)),". It looks like my query didn't like the invoke after function? If completely honest I am not 100% sure why this would cause the issue but after removing the function and a little tweaking my query worked so I am very happy.
Thank you for your response.
Hi everyone,
Please help me in this; I am getting bellow error. I am new to this.
Query I am using..............
let
Source = Json.Document(Web.Contents("https://mycompany.atlassian.net/rest/api/2/search?jql=filter=13330&startAt=0&maxResults=10000"),[Hea..."]])
in
Source
Error I am getting:
Expression.Error: We cannot convert a value of type Record to type Number.
Details:
Value=Record Type=Type
Any help is greatly appreciated.
Kind regards..
Hi @StephenButland,
I test your query on my side but failed, it seems like your query require particular SSL credentials.
Can you confirm which steps caused the issue? You can click on step list to choose other query steps to check which steps cause this issue.
Regards,
Xiaoxin Sheng
Hi @v-shex-msft,
You're correct, the query does require particular SSL credentials.
The step that causes the issue appeared to be "Table = Table.FromList(Entities, Splitter.SplitByNothing(), null, null, ExtraValues.Error)".
After testing it actually turned out to be "Json = Function.InvokeAfter(GetJson(Url), #duration(0,0,0,5)),". It looks like my query didn't like the invoke after function? If completely honest I am not 100% sure why this would cause the issue but after removing the function and a little tweaking my query worked so I am very happy.
Thank you for your response.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
105 | |
88 | |
75 | |
67 |
User | Count |
---|---|
123 | |
112 | |
96 | |
82 | |
72 |