Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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.
| User | Count |
|---|---|
| 8 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |