Hi,
I want to fill an array with all the data that a row of a DataTable has. I tried to do this in blueprints but I can’t iterate in a loop over all pins of a certain row. This DataTable was created in the editor and fill by a CSV (excel). This dataTable have only FText multiline fields.
I have done a C++ blueprint callable class that It receives the DataTable pointer and it returns an array with all data found in the row. The problem is that, when I receive the array it have some unwanted data like this: “NSLOCTEXT(”[7AD1145D40F… and after that my own text. It seems something like control ID.
Can I have any way to obtain only the FText?
I tried a lot of different codes, but is difficult to me to understand the structure of dataTable.
This is my .h:
UCLASS()
class SFTB_API UFillArrayByBPDS_Books : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
UFUNCTION(BlueprintCallable, meta = (DisplayName = "Fill Array by dataTableRow", CompactNodeTitle = "Fill Array by dataTableRow", Keywords = "Array DataTable Fill"), Category = SftB)
static TArray<FText> fillArray(UDataTable *book);
};
This is my .c:
TArray<FText> UFillArrayByBPDS_Books::fillArray(UDataTable *book)
{
TArray<FText> myArray;
TArray < TArray < FString > > miArrayDataTable;
int index; //iterator index
int rowBook = -1; //If we found the title, we store the row number here.
miArrayDataTable = book->GetTableData();
for (index = 0; index < miArrayDataTable.Num(); index++) {
if (miArrayDataTable[index][0].ToLower() == "TitanGreeks") {
rowBook = index;
}
}
if (rowBook != -1)
{
for (index = 0; index < miArrayDataTable[rowBook].Num(); index++){
myArray.Add(FText::FromString(miArrayDataTable[rowBook][index]));
}
}
return myArray;
}
And this is a part of the output:
Any help will be appreciated!