Forum Discussion
Brice_LE-LANN
6 years agoRegular Visitor
Formula.Firewall: Please rebuild this data combination.
Hi all, I have a table contains some values and I need to do a API call for each item with some conditions. I have trouble with this error: "Formula.Firewall: Query references other queries or ...
Brice_LE-LANN
6 years agoRegular Visitor
I am afraid I can't, there is too much data to hide.
I can share the first query though:
let
myKey = "xxx",
pageLimit = 2,
myPageSize= 2,
order = "-modificationDate",
FnGetOnePage = (pageId) as record =>
let
HTTPHeader = [Query = [pageSize = Number.ToText(myPageSize), page = Number.ToText(pageId), sort = order], Headers = [#"Ocp-Apim-Subscription-Key" = apimKey ]],
Source = Json.Document(Web.Contents("https://url.com", HTTPHeader)),
count = try Source[count] otherwise null,
values = try Source[values] otherwise null,
results = [Count=count, Values=values]
in
results,
data = List.Generate(
() => [pageId=1, result = FnGetOnePage(pageId)],
each [pageId]<= pageLimit and [result][Values] <> {},
each [pageId=[pageId]+1, result = [result] & FnGetOnePage(pageId) ]
),
output = Table.FromRecords(data),
allValues = Table.ExpandRecordColumn(output, "result", {"Count", "Values"}, {"result.Count", "result.Values"}),
expendedAllValues = Table.ExpandListColumn(allValues, "result.Values"),
#"Expanded result.Values" = Table.ExpandRecordColumn(expendedAllValues, "result.Values", {"key", "filteringValue"}, {"key", "filteringValue"})
in
#"Expanded result.Values"camargos88
6 years agoCommunity Champion
That's difficult to say without look to the references.
However the problem is when you pass a value from one query to another.
That's why you have to write the code querying everything in the same query.