Download

Blueprint able to process any Data Table that implements a specified Struct

I would like to create a BP that performs an editor task based on data in ANY Data Table that implements a specified Struct. I am very frustrated because all of the examples I have found (and all of my own attempts) all require hard coding a specific Data Table into the BP (eg the Get Data Table Row node). If I don’t specify a specific Data Table, the Out Row pin has a wildcard type. IMHO that is a terrible strategy, the logic of the BP depends on the Struct and not a specific Data Table (that implements that Struct).

A specific example might be a BP that generates instanced static meshes, with the transform parameters being read from a Data Table. This BP should be able to accept ANY Data Table that adheres to the specified Struct. As things stand, I am either (1) hard coding Data Table names (a super ugly compromise) or (2) using a macro (also ugly).

Arguably, the type of a Data Table is its Struct and the BPs should be referencing a type not a hard coded instance of a type (a Data Table). In that way a BP can be super flexible and work with any Data Table that implements the specified Struct. I would be massively grateful for a solution, suggestion or help understanding what I have misunderstood.

UPDATE = WORKAROUND:
Use the option “Reimport With New File” found if you right click the Data Table in the appropriate Content Folder. This will guarantee that the same Struct applies. This lets me drive the BP from a variety of input data files (all adhering to the Data Table’s Struct contract). Ugly but gets me going. Arguably, the Data Table event graph nodes should have been designed to be driven by Structs, allowing a general purpose BP to support any Data Table that is based on the specified Struct. To my mind, a Data Table’s Struct is effectively its type. Of course, I am as fallible as the next guy; and am happy to be corrected by someone more knowledgeable.

Im also curious why this is an issue. My “Out Row” is greyed out on the Get Data Table Row node for reasons unknown.

Im in need to import a selection of data tables so that i can use on begin play or in editor spawning, not dynamically. It is a really nice workflow… Any sort of option that doesn’t require me to set every row name. Some of my data tables may end up being 100 rows long.

Im not a coder, so it would be very appreciated to bring this workflow back to life… there isnt much reason to depreciate this.

What puzzles me the most is that its working just fine in another blueprint. Ive restarted the engine and still get the same. Im also creating a new structure for each data table so they all can occupy their own space… does that matter if im spawning or placing before run time?

Lets hope for data!!!

Re importing a file is an unnecessary step. Why cant we have multiple data tables referenced inside the engine? OR what is the correct workflow to make this happen??

Update: Current work around for me is to just check to see what table to reference through a float variable, and ive copied the entire spline points algorithm as many times as i have unique splines… this i can handle, but it would be great for things to work as expected.