Forum Discussion
marcobi
3 years agoHelper I
Formula.Firewall
Dear Community I got a problem with the Formula.Firewall. I undertake a first request where i gather all deals from pipedrive (pipedrive_deals). Then in the second request I want to use the colum...
marcobi
3 years agoHelper I
And this is the query which is referring to the previous query, taking out the deal_ids
//basic code
let
apiUrl = "https://hello.world.com/v1/deals/",
apiToken = "1234",
idsTable = Pipedrive_deals,
ids = Table.Column(idsTable, "deal_id"),
#"Entfernte alternative Elemente" = List.Alternate(ids,200,40,0),
//ids = {"4334", "4237", "4223", "4222"}, // replace with your own list of IDs --> Pipedrive[id]
getApiResults = (id) =>
let
apiEndpoint = apiUrl & id & "/products?api_token=" & apiToken,
apiResult = Web.Contents(apiEndpoint),
jsonResult = Json.Document(apiResult),
data = jsonResult[data]
in
data,
results = List.Transform(#"Entfernte alternative Elemente", each getApiResults(_)),
filteredResults = List.RemoveNulls(results),
resultsTable = Table.FromColumns(filteredResults),
#"Transponierte Tabelle" = Table.Transpose(resultsTable),
#"Erweiterte Column1" = Table.ExpandRecordColumn(#"Transponierte Tabelle", "Column1", {"id", "deal_id", "product_id"}, {"Column1.id", "Column1.deal_id", "Column1.product_id"})
in
#"Erweiterte Column1"lbendlin
3 years agoSuper User
Your id must be put into RelativePath and the api_token into the query part of Web.Contents