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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

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
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.