The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello I am trying to do a nested API call using M language.
Step 1) The Code makes a call List of links.
Step 2) The links are in csv format.
Step 3) Each link turns into a table
Step 4) Want to merge all the tables into one big table?
Source = scenarios,
#"Changed Type1"=Table.SelectColumns(Source,"Scenario_API_URL"),
#"Changed Type0"= Table.FromRecords({[API_URL = Table.SelectColumns(#"Changed Type1","Scenario_API_URL")]}),
#"Expanded API_URL" = Table.ExpandTableColumn(#"Changed Type0", "API_URL", {"Scenario_API_URL"}, {"API_URL.Scenario_API_URL"}),
#"scenario count"=Table.RowCount(#"Expanded API_URL"),
Generating List using the CSV data
#"New List" =
List.Generate(()=> [ NewTable={},x = 1 , y = {}] , each [x] < #"scenario count" , each [
test = Csv.Document(Web.Contents( #"Expanded API_URL"{x}[API_URL.Scenario_API_URL] ,[Headers=[Authorization="Token token=""API TOKEN"""]]),[Delimiter=",", Columns=30, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Converted to Table" = Table.FromList(test, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
x = [x] + 1
] ,
each [ test]
),
//Promote Header for each table From #"New List"
#"New List2" =
List.Generate(()=> [ x = 1 , y = {}] , each [x] < #"scenario count" , each [y = {Table.PromoteHeaders(#"New List"{x}, [PromoteAllScalars=true])},x=[x]+1] , each [y]),
// Now I just want to combine all the tables In to one big table.
#"New List3" =
List.Generate(()=> [ x = 1, k = {} , #"myEmptyTable" = #table({"Email"})] , each [x] < #"scenario count" , each [#"ResultSet"=Table.Combine({#"New List2"{x}}),x=[x]+1] , each [#"ResultSet"])
in
#"New List3"
The tables does have different numbers of column and rows. My question is I get "Forbidden Access" when I try to combine the tables into one table.
Hi @Anonymous ,
Please check if the access token is legal. If it is legal, please check if it has expired.
Best Regards,
Community Support Team _ Joey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
81 | |
62 | |
54 |
User | Count |
---|---|
246 | |
119 | |
114 | |
87 | |
70 |