I have to admit my confidence has taken a hit with this one.
I have a single list which i extrapolate from a table with the List.Distinct
function.
I have an API I need to call but needs to take an ID which will come from the List.Distinct
output.
so my question is how can I loop over my distinct_list
and feed that as a parameter into my query in the api call.
in Pseudo code this would be:
distinct_table = unique(table[id])
empty_list = []
for each_id in distinct_table[List]:
j = JsonDocument("www.apicall.com?peopleid=each_id")
empty_list.append(j)
Code so far.
let
distinct_list = List.Distinct(Projects[project_id])
Source = Json.Document(Web.Contents("https://api.random.com",
[
RelativePath="/v3/logged-tasks",
Headers = [mytoken],
query = [
person_id = (each row from distinct_list)],
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
Source