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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
frome2000
New Member

Json from Value

Hi I have a raw json that works in Postman and I need to add to a power query to make a POST API request in BI. I am using Json.fromValue, the first part of the POST is to tell the api which fields to return so those inputs have no values for the field however it does not like my syntax, its requesting I close my array after the first field of "deal.id". Its probably a simple fix but I would appreciate some guidance and if you spot any other errors please point them out. Thanks

= let
Json = Json.FromValue({displayingFields=[deal.id,deal.title,deal.primaryContact.totalActivities,deal.primaryContact.id,deal.primaryContact.photo,deal.primaryContact.closedActivities,deal.primaryContact.openActivities,deal.lastModifiedAt,deal.pipeline,deal.stage,deal.owner.name,deal.owner.photo,deal.owner.id,deal.lastCommunicationBy,deal.source,deal.dealValue,deal.status,deal.estimatedCloseDate,deal.lastNote,deal.lastActivityAt,deal.primaryCompany.name,deal.primaryCompany.id,deal.primaryCompany.photo,deal.lostReason,deal.currency,deal.priority,deal.tags,deal.description,deal.closedDate,deal.primaryContact.name,deal.lastCommunicationAt,deal.primaryContact.firstName,deal.primaryContact.lastName}],
filterQuery={group={operator="AND",rules=[{condition="IS_AFTER",moduleName="Deal",field={fieldName=deal.createdAt,displayName="Created At",type="DateTime"},data="Jan 01, 1970 05:30 AM",eventType="DateTime"}]}},sort={fieldName="",order=""},pipeline="",moduleId=4,reportType="get_data",getRecordsCount=true}),

Source = Json.Document(Web.Contents("https://url", [Headers=[#"Content-Type"="application/json",#"accessToken"=""], Content=Json]))
in Source

1 REPLY 1
lbendlin
Super User
Super User

Please refer to the documentation.  Web.Contents - PowerQuery M | Microsoft Learn

Json.FromValue  expects a different format.  Use Text.ToBinary  instead and escape the double quotes with a second one.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors