Set data table row?

Hi,

I have a data table that is connected to a struct. Now I know that by calling the node “get data table row” will get the row from the data table.

Now is there a way that I can write into the data table? I cannot seem to find a node that allows me to change a variable in the data table.

Thanks.

Can anyone help? I still can’t find a way to add a row in a data table.

You add data to the data table by opening it and manually adding rows.
There is no way, through blueprint, to change the data table.
Maybe it would be possible through C++ to somehow write to it and update it during play but I wouldn’t know how to do that.

Now I see that I’ve not been clear enough when first posting the question. Yes I know that I can manually add rows in the editor, but I wanted to know if there was a way to change the data in the rows in runtime using blueprints.

It’s weird that there is an entity such as data table in Unreal, but no implemented functions for it to change or add new data to it. Then why make such a feature in the first place when you don’t give full functionality over it.

I know this is old but i am trying to do the same thing, spent 5min so far but i imagine you can just create seperate data tables for each situation and switch out the whole data table?

I do use Fill Datatable from JSON String

2 Likes

Data table only store data, information.

They are only readable.

But you can store their informations in an array and retrive or manipulate by it.

Basically what OP wants doesn’t exist.
you need to extract the data, create a multidimensional array for it (or maybe a Map depending on what you need), and modify the data on those at runtime.

This can be accomplished by just using AddDataTableRow blueprint node.
Give it the same RowName as an existing row and it will just simply override it.
Use Set members in “rowtype” for modifications.

Something like:

1 Like

Came here from Google… That node doesn’t come up for me (Add Data Table Row).

I’m trying a similar setup to this, but can’t make it work. Nothing is written or updated in the data table. I’ve tried a couple of different variants to see if it’s possible to add a completely new row (instead of updating one) but can’t seem to write to the table at all. I’m a bit confused as to what the point of the Add Data Table Row function is.

Worth mentioning is that I’m running this from an Editor Utility Blueprint.

1 Like

Doesn’t do anything for me either. Last time I stumbled upon this thread a few weeks ago, ending up rebuilding a json string to recreate the whole dt everytime I wanted to add a new entry. This time i just needed to modify entries so I remembered this post and tried the Add Data Table Row to modify a existing entry, the node just doesn’t work for me, neither adding new rows or modifying existing rows…

Make sure you save the asset when your done, or nothing will update. There is a save asset node.