So imagine I have a function called ‘AddItem’. In it, I get a data table row by Row Name. However, I’d like to extend the drop down list seen here to the ‘Item’ input on the function so that I can directly select a valid item in the Data Table without having to enter a name manually.
Ok, so I thought maybe I could resolve this issue by similar means found [here in this similar question][3]. Which does work on instances of an actor, but not for functions. I created the DataTableRowHandle and set that as an input, which did not work.
How would I go about doing this? I really don’t mind if I have to create a C++ BPFL or something similar to achieve this. It would be a huge time save in the end.
The row name is determined by the value in the first column of the table row. If you want it to be something other than numbers you can just make it so that other column is the first one on the left, but you better make sure all the values in it are unique among all rows.
I understand what you’re saying, but that’s not what I’m looking for. I’m asking if I can have that drop down from the Data Table pushed outside the function. So that when I call the function from somewhere else, I can see the same drop down list I’d see when I’m inside the function.
In that case, i believe there is a node you can use from the data table which returns all the row names in an array. You can use That array to help populate other lists and set text labels on newly spawned widgets etc.
Unfortunately I dont remember the exact name of the node. Probably GetTableRowNames or GetTableKeys or something like that.
Probably, there is no way to make it works in Blueprints.
But if you know C++ start looking into K2Node’s implementations, especially for UK2Node_GetDataTableRow class and how it receives updates from SDataTableStructComboBox.
Since it is BlueprintCallable, you’ll be able to use that function in your BPs.
If you want to implement the function’s internal logic in BP rather than C++, you can just make your BP class inherit the C++ class and override the function in the BP.