The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
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.