【发布时间】:2019-07-22 13:43:06
【问题描述】:
我正在尝试在 Dynamics 365 Connected Field Service 中创建新记录。我在流分析中创建了一个查询,它将设备数据发送到队列。
例如,在 Azure LogicApps 中,有效负载消息如下所示
{"Device":"ESP8266","AccValue":21168,"Location":"$GPRMC ..."}
使用 parseJSON 解析此消息,以便我可以从有效负载中提取每个字段。在下一个创建新记录的函数中,我可以简单地将 AccValue 和 Location 用于列 Description。但是,当我尝试将 Device 参数设置为 Device 时,出现此错误:
{
"status":
400,
"message":
"An error occurred while validating input parameters: Microsoft.OData.ODataException: A 'PrimitiveValue' node with non-null value was found when trying to read the value of the property 'msdyn_Device'; however, a 'StartArray'
node, a 'StartObject' node, or a 'PrimitiveValue' node with null value was expected.\r\n at Microsoft.OData.JsonLight.ODataJsonLightPropertyAndValueDeserializer.ValidateExpandedNestedResourceInfoPropertyValue(IJsonReader jsonReader, Nullable`1 isCollection,
String propertyName)\r\n at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadPropertyWithValue(IODataJsonLightReaderResourceState resourceState, String propertyName, Boolean isDeltaResourceSet)\r\n at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.<>c__DisplayClass9_0.<ReadResourceContent>b__0(PropertyParsingResult
propertyParsingResult, String propertyName)\r\n at Microsoft.OData.JsonLight.ODataJsonLightDeserializer.ProcessProperty(PropertyAndAnnotationCollector propertyAndAnnotationCollector, Func`2 readPropertyAnnotationValue, Action`2 handleProperty)\r\n at Microsoft.OData.JsonLight.ODataJsonLightResourceDeserializer.ReadResourceContent(IODataJsonLightReaderResourceState
resourceState)\r\n at Microsoft.OData.JsonLight.ODataJsonLightReader.StartReadingResource()\r\n at Microsoft.OData.JsonLight.ODataJsonLightReader.ReadAtStartImplementationSynchronously(PropertyAndAnnotationCollector propertyAndAnnotationCollector)\r\n at Microsoft.OData.ODataReaderCore.ReadImplementation()\r\n
at Microsoft.OData.ODataReaderCore.InterceptException[T](Func`1 action)\r\n at System.Web.OData.Formatter.Deserialization.ODataReaderExtensions.ReadResourceOrResourceSet(ODataReader reader)\r\n at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.Read(ODataMessageReader
messageReader, Type type, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)",
"source":
"x.crm4.dynamics.com",
"errors": [],
"debugInfo":
"clientRequestId: 03d448c2-e6fe-4bac-b6c4-19328bc2b1bb"
}
如果我省略了“设备”参数,则 IoT 警报会列在 D365 CFS 中:
设备及其信息应该是新创建的,作为 Dynamics 365 Connected Field Service 中“描述”列的 GPS 和 AccValue 和“设备”列的设备名称 (ESP8266) 的记录。它已在 IoT 中心注册并正确发送数据。
有什么办法可以解决这个问题?
【问题讨论】:
标签: azure-logic-apps azure-iot-hub dynamics-365