Notifications
Announcements
No record found.
Hi All,
I have a composite data entity that has been exposed on Odata Endpoint. External application passes an XML message to the Odata Endpoint and records get created accordingly. I have one field which is optional in the data source of an entity, so the external application is not including that field tag in the xml message. But on D365 side, we are getting an error about incorrect XML format. So, basically D365 is expecting the empty XML tag to be there even when no value is there for the field. Is there any option in D365 to avoid this error, if the optional field tag is not passed in the XML message?
Thanks,
Baber.
Can you elaborate what you did, please? Because composite entities aren't available in OData services (source). Maybe you mean data management package API, or maybe you have a data entity with a string field where you're passing XML containing data for a composite entity, or something.
Regarding the optional element, it sounds like you have it in source mapping.
Hi Martin,
I have setup a Import Data project under Data management framework and added Composite Data Entity with Source data format XML-Element. The recurring data job is setup which runs after every 10 minutes and processes the incoming XML messages. The external application uses the enqueue operation to pass the XML message to the entity. Hope this answers your question. Sorry for mentioning Odata in my first post.
All right, so you're using the recurring integrations API.
As I mentioned, it seems to me that you have the field included in source mapping. You should remove it from there if it doesn't exist in the input file.
It is not always the case that the input file doesn't have the value for that specific field. Just for ease of understanding, consider the field name as "Field1". It is there in the mapping, because it will not always be empty, but when it is empty, the external application is not including the XML tag <Field1></Field1> in the XML message. Hence D365 is giving error that the XML is in incorrect format. Is there any way to make the whole field tag optional ? Please note that the field is already optional in the Data entity.
I don't think you can use files with two different structures against a single mapping. If you map a field from source and it's not there, mapping will fail.
If the external application isn't able to provide a file matching the expected schema, you'll have to transform the file before import.
By the way, notice that this isn't anything specific to composite entities.
Thanks Martin for your response. Can you please provide any guidance on how can I do the transformation if an XML tag is absent in the message. Can I add that through transofrmation if it is not there to avoid the error message?
Yes, using Transformations in source to staging mapping should be possible. These transformations applies before import, which allows you to change the schema to what's expected by data management. Which is your case too.
Any pointers in regards to transformation like in my case? Any docs or blogs that I can refer to ?
Try Adding New Element using XSLT, for instance. One of the first links I got by a search engine.
Quick question. I used the link provided above and created an XSLT file based on our requirements to insert the missing tag in the XML if it is non-existent, but as soon as I click on Apply transforms button, it gives me below error:
Record for Id - J5KOBG3UJ not found.
The above message doesn't tell me anything about the error and I have no clue what could be missing in the XSLT file. Any idea, how can I troubleshoot this ?
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 559 Most Valuable Professional
André Arnaud de Cal... 464 Super User 2025 Season 2
Sohaib Cheema 250 User Group Leader