cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BrianSlalomMS
Level: Powered On

Work around for a bug when importing into a CDS entity

I fought this bug for weeks. Support eventually put me in touch with a developer from the MS Data Integration team who confirmed I was being bitten by a bug but showed me a work around for it.

The error occurs when rerunning an import query (called a Data Integration Project in PowerApps) and the data type of a destination field has been changed since the prior import.

The developer said the destination entity's schema is cached with the query and, when the query is rerun, it does not recognize that a destination field type has been changed and does not refresh the cache. 

In my case I changed the type of datetime field and received this error on the import attempt, 

"[Bad Request]: {"error":{"code":"0x0","message":"An error occurred while validating input parameters: Microsoft.OData.ODataException: Cannot convert the literal '' to the expected type 'Edm.DateTimeOffset'. ---> System.FormatException: The string '' is not a valid AllXsd value.".

I image other data type changes would cause different errors.

The workaround is to force the query to refresh its cache with the lastest definition of the entity and its field type definitions. You can do this in at least two different ways.

  1. You can force an 'Entity Refresh' and reexecution of the query from the Data Integration Projects page using the 'Refresh project' command in the … menu. 
  2. You can force just a refresh of the entites by going to the query's "Execution History" page, loping off the "/executionHistory" portion at the end of the URL, and hitting the resulting url. This will expost a page containing a "Refresh Entities" command (as well as some other commands which might be useful). There must be an easier way to get to this page but this is the method the developer showed me.

The developer said this bug should be fixed in the next release, which should be released about now, but I have not confirmed it.

Community Support Team Rank
Community Support Team

Re: Work around for a bug when importing into a CDS entity

Hi @BrianSlalomMS,

 

Thanks for sharing the workaround here. Hope others could benefit from it.

 

Regards,

Mona

Highlighted
Wauters
Level: Powered On

Re: Work around for a bug when importing into a CDS entity

Thanks BrianSlalomMS

 

Your post helped me resolve the issue I had when exporting data from a CDS entity. I've written a small post about the workaround on how to refresh the entity cache of the PowerApps Data Integrator. It seems that the issue is still present (at least for exporting of data).

 

https://www.dynamict.eu/2018/12/16/missing-fields-when-exporting-data-from-powerapps-cds-for-apps/