Name datatable with variable

With a Map, you could:

hello,
Is it possible to name a datatable instead pick it in the list ?
I tried to do with an append, but it failed.

Sending to game mode :

You’re not sending anything. The Find field is empty.


Why not create a proper Map, do you need to create it on the fly? Why not have a Map with the DataTables in the Game Mode; any blueprint can request access via a getter function by name. This way you do not even need to create hard references or duplicate any code.


I might be misunderstanding what you’re trying to achieve, though.

In your exemple you set 2 map (data_1
and data_2), in my case I unable to
set more than 1

The map keys must have unique values. When creating a Map ensure there are no repeating names. If you just mash + button it will try to add more than 1 key with no name. 2 keys with no names are identical values - that’s why you cannot do it.

Put the full names of the DataTables in the Map. A widget sends a request to the Game Mode, the Game Mode picks what’s needed and sends it off to another widget.

Is that not what you’re after?

Thanks for your response. I think the way you propose is the correct one, but I fail to apply it in my context.
To be more specific, I have different datatable linked to the same structure (QG_A, QG_B, …) A, B, … depends of a text bind to a button. So text QG_ is static.

I send this datatable to the Game mode blueprint, to be able to access to it on another widget.

When I try your solution I certainly miss something important :

Sending to game mode :

Getting to the widget :

Compilation show no problem, but it seems that variable created with map, is empty…

In your exemple you set 2 map (data_1 and data_2), in my case I unable to set more than 1.
It’s why I put a Make map node, but the input value 0 ask me a datatable, and it is exactly what I want to avoid.

Yes that’s what i’m looking for.
I try to directly map inside the game mode :

If i understand right the map as you explain above

I create a variable map string/datatable, for map I include for exemple 2 datatables I have.
I’m looking for an append with the text “QG_” and a variable.
I populate the pin in find node searching the appended string into the variable map. So I guess find look for the text “QG_variable” on 2 the mapped datatable names ?
Then i return the find result into a datatable variable.

Inside my widget I do the following :

When a button is clicked I try to populate wrap box with another widget

Those last widget is a button, where I want to list datas :

Where I’m wrong ?

This actually looks about right, logical.

Find returns a bool - does it find anything? Does the Army var contain the text you need?

I did a debug :
Army var is correct, but datatabletable variable seems to send “none” as result

It would be much easier if you connected a branch into the Find node as suggested and checked if it returns True / False.

I never used a method like this. It is possible the nodes cannot determine the correct DataTable object here.

One important question here - do those DataTables use identical structs? I’m almost certain here this will not work if the structs are different.

Branch return…nothing .
And yes, datatables use the same structure.

However, If I set a default value to the datatablefind variable, everything works fine.
I think the find node return nothing, so variable is empty.

Branch return…nothing.

So it returns False, right? Which is fine, so we know something else is up.

However, If I set a default value to
the datatablefind variable, everything
works fine. I think the find node
return nothing, so variable is empty.

This would indicate something is wrong with the names - Print what the Append node spits out and see what is says.

I finally succed ^^
your solution was correct, but not inside the gamemode BP.

I reverse your solution the way i did in first place.
First create variable in widget BP, then send it to the gamemode.

Inside others BP, get the gamemode variable, and it works !

Thanks a lot for your help, really appreciated !
I tick topic as solved.