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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
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.