web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

Enum Entity field appearing as 0 when file is exported even though it should be empty

(0) ShareShare
ReportReport
Posted on by 1,965

Hi,

I have an entity with multiple datasources (outer join)

When there is no related records in one of the datasources then the fields of that datasource appear empty in the exported file. However if it was an enum filed it always appear as 0 if no records are related. How to make it empty? Because 0 means that it has a value

I have the same question (0)
  • Suggested answer
    Sergei Minozhenko Profile Picture
    23,093 on at

    Hi IntegrationBegginer,

    I'm not sure if you can replace 0 with an empty value for the enum field, as it's stored as an integer and the default value is 0.

    Maybe you can check if flight EnableEnumSymbolSupportForImportExport can help you and it will export empty value instead of the real symbol.

    community.dynamics.com/.../composite-data-entity-xml-export-enum-fields

    Another option is to create a string computed column field and return an empty value if the value is null and a real value if is not null.

  • Suggested answer
    Dynamics Community 101 Profile Picture
    310 on at

    Hi IntegrationBeginner,

    When you export enum values you have to write "enum2str".If you skip that you get integer values

    Regards,

    Atul

    dynamicscommunity101.blogspot.com/

  • .. Profile Picture
    1,965 on at

    Hi Sergie,

    I thought this feature is to convert integer values to string. So i think it will convert the 0 to it's string value. Or maybe u're right it will make it empty. I need to try

    However i saw this feature as well

    DMFDisableEnumFieldDefaultValueMapping. Could this work?

    Hi Atul,

    I can't use enum2str because i'm just using the field directly. The only othet option would be creating a computed column as sergie suggested

  • .. Profile Picture
    1,965 on at

    Hi Sergie,

    I noticed that the problem is not because of composite but because of staging table.

    So if you try to export a normal entity and enable staging you'll get the same behaviour.

    And this doesn't happen to enums only, it happens to enums, dates and int.

    However if you skip staging these will appear empty as expected.

    And as i mentioned this dataSource is outer joined with the root entity and when there is no recrods in the table

    my enum should be empty instead of 0 and my integer should be empty instead of 0. Also the date should be empty instead of defaulted value.

    I tried these two flights but with no luck:

    EnableEnumSymbolSupportForImportExport AND DMFDisableEnumFieldDefaultValueMapping

    Is there a way to make staging table accept null values?

  • Sergei Minozhenko Profile Picture
    23,093 on at

    Hi IntegrationBegginer,

    DB fields in F&O can't be defined as null. So I'm afraid the only possible solution is too use computed column if you want to implement the change in F&O.

    Can't consumer of the entity use another field to identify if outer joined record doesn't exist?

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.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Martin Dráb Profile Picture

Martin Dráb 646 Most Valuable Professional

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 529 Super User 2025 Season 2

#3
Sohaib Cheema Profile Picture

Sohaib Cheema 285 User Group Leader

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans