Save and Export User Input from Editable Text Field

Hello.
Preemptively thank you for your help - I am winging learning UE5 so any help is really appreciated.

I am working on a project in which I need to be able to export user input from an editable text box. The project is for university research and basically the game plays like a 3D Visual Novel, but when the NPC dialogue partner asks a question, we have an editable text field that appears for the user to type in their response. We need to be able to, OnCommit, save their inputted answers. All of these answers need to then be able to be exported. We could get away with an export on each commit, but best would be to save all their responses and then export at the end.

Ideas or suggestions of where to look to find the answer myself are really appreciated.

1 Like

I need the same info. Less complicated, I would assume (just want a username and password entered to be saved)… And nobody replied! ek. Did you ever find a solution?

Afaik you’ll need a bit of C++, or a plugin, to be able to write to file.

The C++ side offers functions that make it very simple, such as FFileHelper::SaveStringToFile and FFileHelper::SaveStringArrayToFile.

You just need a wrapper to expose either function to the Blueprints. There should be several plugins doing that for free.

If you can compile it yourself, it should be as simple as this :

#pragma once

#include "CoreMinimal.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "UMyFunctionLibrary.generated.h"

UCLASS()
class UMyFunctionLibrary : public UBlueprintFunctionLibrary
{
    GENERATED_BODY()

    UFUNCTION(BlueprintCallable)
    static bool SaveStringToFile(const FString& Str, const FString& FilePath)
    {
        return FFileHelper::SaveStringToFile(Str, *FilePath, EEncodingOptions::ForceUTF8);
    }

    UFUNCTION(BlueprintCallable)
    static bool SaveStringArrayToFile(const TArray<FString>& Lines, const FString& FilePath)
    {
        return FFIleHelper::SaveStringArrayToFile(Lines, *FilePath, EEncodingOptions::ForceUTF8);
    }
};