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
Hi camargos88
thanks for the reply, much appreciated.
I have tried to put it in one query but it gave me the same output.
let
//creating my list in one query:
myItemList = Table.SelectRows(Table.Distinct( Table.SelectColumns(otherTable, { "key", "filteringValue"})), each ([filteringValue] = "KEYWORD"))[key],
// function to do one call per item
FnGetOneItem = (itemId) as table =>
let
myKey = "xxx",
pageLimit = 2,
myPageSize= 2,
order = "-modificationDate",
HTTPHeader = [RelativePath = itemId & "/query", 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)),
values = try Source[values] otherwise null,
results = [Values=values]
in
results,
data = List.Generate(
() => [pageId=1, result = FnGetOnePage(pageId)],
each [pageId]<= pageLimit and [result][Values] <> {},
each [pageId=[pageId]+1, url=urlroot & Number.ToText(pageId), result = [result] & FnGetOnePage(pageId) ]
),
output = Table.FromRecords(data)
in output,
Source = List.Generate(
() => [position=0, storeId = myItemList{position}, outputTable = FnGetOneItem(myItemList{position})],
each [position] < List.Count(myItemList),
each [position=[position]+1, storeId = myItemList{position}, outputTable = FnGetOneItem(myItemList{position})]
),
Final = Table.FromRecords(Source)
in
Final Thank you again, and if you have any idea, I'll take it
camargos88
6 years agoCommunity Champion
Try changing this part:
myItemList = Table.SelectRows(Table.Distinct( Table.SelectColumns(otherTable, { "key", "filteringValue"})), each ([filteringValue] = "KEYWORD"))[key],
It receives other table "otherTable", try querying this table in the same query as well.