Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
121 | |
79 | |
48 | |
38 | |
31 |
User | Count |
---|---|
192 | |
79 | |
70 | |
50 | |
42 |