Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

How to use URL provided in result from JSON response to another query. Formula.Firewall

I am using HTTP POST to reach a data API that provides a JSON response which contains a URL to the actual report data in CSV form (JSON option available too).

If I try to use the URL as a parameter in another query I get the Formula Firewall issue. I tried integrating the two queries together but I still get that error..

Here's the query that provides the URL for the CSV (with some parts of the URL and headers removed):

let
    Source = Json.Document(Web.Contents("https:/blahblah.com/report_type?companyKey=***Key***&startTime=1559313000000&endTime=1561905000000&.....&reportFormat=CSV")),
    result = Source[result],
    downloadUrl1 = result[downloadUrl]
in
    downloadUrl1

The output of this is a URL, I can turn it into a parameter and attempt to use it in the next query (parameter is called "p_URL"):

let
    Source = Csv.Document(Web.Contents(p_URL),[Delimiter=",", Columns=81, Encoding=65001, QuoteStyle=QuoteStyle.None])
in
    Source

Output should be a data table from the CSV, and it works when I enter in the actual URL from the first query, but when I use the parameter or nest the first query inside the second one I get this:

Formula.Firewall: Query 'download?companyKey=***Key***' (step 'Source') references other queries or steps, so it may not directly access a data source. Please rebuild this data combination.

 

  • Anonymous's avatar
    Anonymous
    7 years ago

    Ending up solving the problem myself. I changed the privacy settings...
    Then I had the problem of the data loading too quickly and getting a result that just said "not finished", but while I was fiddling around with it the data appeared in tablular form from CSV as expected (and tried with JSON as well, which also worked). I'm not sure if I did something to make it work or if it just needed time.

     

     

1 Reply

  • Anonymous's avatar
    Anonymous
    Not applicable

    Ending up solving the problem myself. I changed the privacy settings...
    Then I had the problem of the data loading too quickly and getting a result that just said "not finished", but while I was fiddling around with it the data appeared in tablular form from CSV as expected (and tried with JSON as well, which also worked). I'm not sure if I did something to make it work or if it just needed time.