Data Table Enums Fail to import correctly

Enums are unusable in data tables for importing. They import solely as their default “zero” value (albeit with the name wrong - but that still “functions” fine).

Sample enum: Dog, Cat, Bird

Sample default names: NewEnumeration0, NewEnumeration1, NewEnumeration2

Sample list: Dog, Bird, Bird, Cat, Dog

Result: NewEnumeration0, NewEnumeration0, NewEnumeration0, NewEnumeration0, NewEnumeration0

…so the actual values have been lost on import. You essentially have to manually manipulate everything within the editor itself, so you cannot use external software to change the data.

Can I just check what you mean by “default names” above?

So, if I understand this correctly, you’ve made an enum (in C++ or as an asset?) containing the entries “Dog”, “Cat”, and “Bird”, and have then made a data table based upon this enum and added several entries to it, but this data is lost if you export and re-import the data table?

Hi Envisionaer,

We have not heard from you in several days. I am marking this thread as answered for tracking purposes. If you are still experiencing this error, please comment with the requested information.

I’m sorry, I thought I had already addressed this response several days ago.

No, actually, I created a Blueprint Enum called ESkillType. In my case, the Enum values were specifically “None”, “Gun”, “Melee”, and “Spell”. I then created a struct that contained this Enum, among other things, and then a data table based on the struct. When importing values into the data table in 4.8, any non-Enum values are imported properly, but those that are Enums will input only the default, lowest-valued option. Entries of Enums in the data table will additionally only be shown using their would-be default names as well. So, for the value of “Melee”, the actual text displayed in the master list for the Data Table tab is “NewEnumeration2”. After a fresh import, the lower area displaying an individual row will have “None” listed in the Enum’s section of the Struct even as “NewEnumeration0” is imported into the top section. If I select the Enum slot and pick “Melee” in the drop down, the value will switch to Melee in the bottom area and will become “NewEnumeration2” in the top area to reflect the change.

So, there are two distinct bugs:

  1. Importing the values of a Blueprint Enum into a Data Table from a .csv file causes the value of the enum to become the enum’s default value.
  2. The text in the top section of the Data Table will display the default name that would have been assigned to the slot in the enum if it hadn’t been renamed. The bottom section will behave as normal.

Thanks for the extra info.

I’ve raised UE-17445 to look into this. I’ll update you again once I know more.

I’ve tested this in 4.7 and 4.8, and I can’t see that the behaviour has changed between these two versions.

For User Defined Enums (the enum assets you create, rather than C++ enums) the Data Table editor UI has always shown you the “NewEnumerator0” style names, and the CSV importing has only ever worked with the “NewEnumerator0” style names. I asked the Blueprints team about this, who confirmed that the internal enum name is immutable, and what you’re changing in the enum editor is the display name - this is done to avoid losing references when renaming enum entries.

I can change the Data Table editor to show you the display name in the data grid, but the CSV exporting and importing is likely best using the internal enum name to avoid referencing issues when renaming your enums. I could have the import fallback to using testing display name if it doesn’t find a match, but this would be vulnerable to data loss if the enum entries were renamed and some old CSV data was re-imported.

It is worth noting that this issue only affects User Defined Enums, and that C++ enums will always use the name of the enum entry defined in code for their CSV import/export.

I’ve made the aforementioned changes as 6a15cc3.

These changes will be present in 4.9.

Thanks for all the hard work! I look forward to using them in the next update.

Just to be clear, from your description, are you indicating that if I were to contain a spreadsheet for my example and wished to import it, that it would first check to see whether I had put “NewEnumeration#” in the cell, and then if it does not find those, it would begin searching for a string containing one of “None”, “Gun”, “Melee”, & “Spell” to fill them in properly?

Yeah, that’s right.