Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hello,
I have this code, but I wanna get all date of my students,at once. With this code below I get one-per-one
let
url = "http://webservices.sponteweb.com.br/WSApiSponteRest/api/students",
Body = "{""student_id"": ""61""}",
source = Json.Document(Web.Contents(url, [Headers = [#"Content-Type"="application/json", #"Accept"="application/json", #"api_key"="XXXXX"], Content = Text.ToBinary(Body)]))
in
source
Solved! Go to Solution.
Hi @ViniDreamit
You can call the API repeatedly using List.Transform as is shown in this similar question
Solved: Re: DATA for multiple years - Microsoft Power BI Community
For you, you could use code liek this heer the Student ID's are specified in a list - this example just gets ID's 1 to 5. Change this accordingly.
let
url = "http://webservices.sponteweb.com.br/WSApiSponteRest/api/students",
StudentIDs = {1 .. 5},
GetWebPage = (StudentID) => let
Body = "{""student_id"": """ & StudentID & """}",
Source = Json.Document(Web.Contents(url, [Headers = [#"Content-Type"="application/json", #"Accept"="application/json", #"api_key"="XXXXX"], Content = Text.ToBinary(Body)]))
in Source,
WebPages = List.Transform(StudentIDs, each GetWebPage(Text.From(_))),
#"Converted to Table" = Table.FromList(WebPages, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
Or if you have a column with the sudent ID's, that coudl be passed into the function to call the API. If this is the case please provide some sample data and/or an image of your table so I can see how it is structured.
Regards
Phil
Proud to be a Super User!
Thanks a lot Phil!! It's working very well!
Hi @ViniDreamit
You can call the API repeatedly using List.Transform as is shown in this similar question
Solved: Re: DATA for multiple years - Microsoft Power BI Community
For you, you could use code liek this heer the Student ID's are specified in a list - this example just gets ID's 1 to 5. Change this accordingly.
let
url = "http://webservices.sponteweb.com.br/WSApiSponteRest/api/students",
StudentIDs = {1 .. 5},
GetWebPage = (StudentID) => let
Body = "{""student_id"": """ & StudentID & """}",
Source = Json.Document(Web.Contents(url, [Headers = [#"Content-Type"="application/json", #"Accept"="application/json", #"api_key"="XXXXX"], Content = Text.ToBinary(Body)]))
in Source,
WebPages = List.Transform(StudentIDs, each GetWebPage(Text.From(_))),
#"Converted to Table" = Table.FromList(WebPages, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
in
#"Converted to Table"
Or if you have a column with the sudent ID's, that coudl be passed into the function to call the API. If this is the case please provide some sample data and/or an image of your table so I can see how it is structured.
Regards
Phil
Proud to be a Super User!
I don't have a list, but it's work perfectly!
Thanks a lotttt
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
13 | |
8 | |
8 | |
7 |
User | Count |
---|---|
17 | |
13 | |
7 | |
6 | |
6 |