Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
SJMC_LAB
Regular Visitor

Json POST Request through each row

Hi, 

New query user here. I have a table with one column as "start date", and the second column as "end date". I need to make JSON POST query using the two dates as parameters to be passed through in a JSON body. How do I make POST query for each row and combine all data in a single table?

 

I know how to make a single working query, but how do I loop through each row in advanced editor? I have done some research, but i couldn't find similar situations using more than one columns as parameters. My working query is like this:

 

let

          url = " http://www.xxx.xxx/..... ",

          headers=[#"accept"="application/json", #"Content-Type"="application/x-www-form-urlencoded"],

          PostBody = [

                    user_id =  "lasf3sd5423e1dsd2asdsdsdf",

                    startTime = DateTime.ToText("2022-03-01", "yyyy-MM-dd h:mm"),

                    endTime = DateTime.ToText(DateTime.LocalNow(), "yyyy-MM-dd h:mm")

                      ], 

 

          response = Json.Document(Web.Contents(url,

                     [

                               Headers = headers,

                               Content = Text.ToBinary(Uri.BuildQueryString(PostBody))

                     ]

                    )),

 

In

response

 

Thank you!

1 REPLY 1
Anonymous
Not applicable

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.