Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
I am new to getting datat from an API. There are a few challenges I am facing.
1) I can get the data using specific paramaters, but want to use a reference table to call the API for each parameter such as date.
2) I am trying to get multiple dates and associated records into one table - Dont want to do this manually. Is there a function that can use a table as a list to replace the value and add each API call as a record in teh same table
let
Source = Json.Document(Web.Contents("https://api.sportsdata.io/v3/nba/projections/json/DfsSlatesByDate/2020-MAR-08?key=###MYKEY###")),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"SlateID", "Operator", "OperatorSlateID", "OperatorName", "OperatorDay", "OperatorStartTime", "NumberOfGames", "IsMultiDaySlate", "RemovedByOperator", "OperatorGameType", "SalaryCap", "SlateRosterSlots", "DfsSlateGames", "DfsSlatePlayers"}, {"Column1.SlateID", "Column1.Operator", "Column1.OperatorSlateID", "Column1.OperatorName", "Column1.OperatorDay", "Column1.OperatorStartTime", "Column1.NumberOfGames", "Column1.IsMultiDaySlate", "Column1.RemovedByOperator", "Column1.OperatorGameType", "Column1.SalaryCap", "Column1.SlateRosterSlots", "Column1.DfsSlateGames", "Column1.DfsSlatePlayers"})
in
#"Expanded Column1"
My Second Challenge is calling the API when there are two variables such as date and ID, Even when I do this for one manual API call the data table needs to be pivoted so the field names are columns.
1)Need to dynamically pass dates and ID's into the API Call basedon an existing tables as the list of values for each
2)Need to pivot the results as columns
let
Source = Json.Document(Web.Contents("https://api.sportsdata.io/v3/nba/projections/json/PlayerGameProjectionStatsByPlayer/2020-MAR-08/20000877?key=###MYKEY###"))
in
Source
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
72 | |
71 | |
68 | |
42 | |
42 |
User | Count |
---|---|
46 | |
40 | |
28 | |
27 | |
26 |