Business Applications, Model-driven, PowerApps

PowerApps Dataflow: is your CDS entity primary field name exactly the same as an entity name? Well, don’t.

The Issue:

Unable to load data to the existing custom entity on CDS from CSV or Excel via Dataflow.

We renamed the primary Name field for our custom entity and this is how it’s all started.

Error:

Load to Common Data
Service failed. Details: Bad Request
{"error":{"code":"0x0","message":"An
error occurred while validating input parameters:
Microsoft.OData.ODataException: Does not support untyped value in non-open
type.\r\n at
System.Web.OData.Formatter.Deserialization.DeserializationHelpers.ApplyProperty(ODataProperty
property, IEdmStructuredTypeReference resourceType, Object resource,
ODataDeserializerProvider deserializerProvider, ODataDeserializerContext
readContext)\r\n at
System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ApplyStructuralProperties(Object
resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference
structuredType, ODataDeserializerContext readContext)\r\n at
Microsoft.Crm.Extensibility.CrmODataEntityDeserializer.ApplyStructuralProperties(Object
resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference
structuredType, ODataDeserializerContext readContext)\r\n at System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ReadResource(ODataResourceWrapper
resourceWrapper, IEdmStructuredTypeReference structuredType,
ODataDeserializerContext readContext)\r\n at
System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type,
Stream readStream, HttpContent content, IFormatterLogger
formatterLogger)","innererror":{"message":"An
error occurred while validating input parameters:
Microsoft.OData.ODataException: Does not support untyped value in non-open
type.\r\n at
System.Web.OData.Formatter.Deserialization.DeserializationHelpers.ApplyProperty(ODataProperty
property, IEdmStructuredTypeReference resourceType, Object resource,
ODataDeserializerProvider deserializerProvider, ODataDeserializerContext
readContext)\r\n at
System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ApplyStructuralProperties(Object
resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference
structuredType, ODataDeserializerContext readContext)\r\n at Microsoft.Crm.Extensibility.CrmODataEntityDeserializer.ApplyStructuralProperties(Object
resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference
structuredType, ODataDeserializerContext readContext)\r\n at
System.Web.OData.Formatter.Deserialization.ODataResourceDeserializer.ReadResource(ODataResourceWrapper
resourceWrapper, IEdmStructuredTypeReference structuredType,
ODataDeserializerContext readContext)\r\n at
System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type,
Stream readStream, HttpContent content, IFormatterLogger
formatterLogger)","type":"Microsoft.Crm.CrmHttpException","stacktrace":"
at
Microsoft.Crm.Extensibility.OData.CrmODataUtilities.ValidateInputParameters(ModelStateDictionary
controllerModelState)\r\n at Microsoft.Crm.Extensibility.OData.EntityController.PostEntitySetImplementation(String&
entitySetName, EdmEntityObject entityObject)\r\n at
Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger
logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1
additionalCustomProperties)\r\n at
Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger,
XrmTelemetryActivityType activityType, Func`1 func)\r\n at
lambda_method(Closure , Object , Object[] )\r\n at
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object
instance, Object[] methodParameters)\r\n at
System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext
controllerContext, IDictionary`2 arguments, CancellationToken
cancellationToken)\r\n--- End of stack trace from previous location where
exception was thrown ---\r\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n---
End of stack trace from previous location where exception was thrown ---\r\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n---
End of stack trace from previous location where exception was thrown ---\r\n at
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n at
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task
task)\r\n at
System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"}}}.
(Job ID: f5780a7d-bf8a-41e0-9a1b-4a1e5bc64ac7)

Testing 1 . Trying to load data to a new entity … It doesn’t like that entity name is the same as a primary field name, apparently.

Testing 2. Let’s change the entity name

Test 2. Rename a primary field. Trying to load data to the existing entity

The conclusion

After the 2 weeks long conversation with the support team this is your available solution: don’t name your primary field the same way you named your CDS custom entity. You will not be able to use import via Dataflow!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s