Hallo zusammen,
ich muss einen neuen IoT Alert Eintrag in Dynamics 365 für Connected Field Service erstellen. Der ESP8266 ist bereits mit dem IoThub verbunden und sendet Daten. Diese Daten werden in Stream Analytics an die Warteschlange Queue weitergegeben.
Die Payload sieht wie folgt aus:
{"Device":"ESP8266","AccValue":21156,"Location":"$GPRMC:X"} und durch die Funktion ParseJson kann ich auf die einzelnen Attribute zugreifen.
Als nächstes habe ich ein "Create a new Record (Preview)" erstellt mit dem ich den Eintrag im Dynamics 365 für Connected Field Service erstellen möchte. AccValue und Location werden für das Feld "Description" verwendet und Device sollte
für das Feld "Device" verwendet werden. Leider bekomme ich jedes Mal folgende Fehlermeldung beim Ausführen:
{
"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"
}
Wenn ich den Device Parameter weglasse dann funktioniert der Prozess. Jedoch brauche ich den Namen Device als Device (ESP8266)in Connected Field Service. Kann mir jemand vielleicht hier weiterhelfen?