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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Richard_Halsall
Helper IV
Helper IV

Converting Postman Body Request to JSON body

Hi

 

I am facing an issue to replicate the body POST request from Postman into PQ.

 

This works in Postman

{
    "query""query { boards (ids: 123456789) { items_page (limit:500, query_params: {rules: [{column_id: \"person\", compare_value: [\"Alex\"], operator: contains_text}]}) { cursor items { id name column_values { column{title} text}}}}}"
}
 
And here is my PQ

let
Key = MondayKey,
Board = id_board,
ColumnID = ColumnIDPerson,
PM = PMAlex,
 
Source = Web.Contents(MondayBaseURL,
 
[
        RelativePath="v2",
        Headers=[
            #"Method"="POST",
            #"Content-Type"="application/json",
            #"Authorization"= Key,
            #"API-Version" = "2023-10"
            ],
            Content=Text.ToBinary("{""query"": { boards (ids: " & Board & ") {items_page (limit:500, query_params: {rules: [{""column_id"": " & ColumnID & " , ""compare_value"":  " & PM & " , ""operator"": contains_text}]}) { cursor items { id name column_values { column{title} text}}}}}""}")
        ]
    ),
    #"JSON" = Json.Document(Source,65001),
 
Highlighted in red is the problem code. I have 2 parameters both text named
ColumnID value = \"person\"
PM value = \"Alex\"
 
Tried multiple formats but just cannot resolve. Any help would be appreciated
 
Thanks
1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Have a look at example 2 Web.Contents - PowerQuery M | Microsoft Learn

 

Something like

 

Content = Json.FromValue([query= "query { boards (ids: 123456789) { items_page (limit:500, query_params: {rules: [{column_id: ""person"", compare_value: [""Alex""], operator: contains_text}]}) { cursor items { id name column_values { column{title} text}}}}}"])

View solution in original post

2 REPLIES 2
lbendlin
Super User
Super User

Have a look at example 2 Web.Contents - PowerQuery M | Microsoft Learn

 

Something like

 

Content = Json.FromValue([query= "query { boards (ids: 123456789) { items_page (limit:500, query_params: {rules: [{column_id: ""person"", compare_value: [""Alex""], operator: contains_text}]}) { cursor items { id name column_values { column{title} text}}}}}"])

@lbendlin Many thanks

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.