An addendum: only GetMapName() will add something like UEDPIE prefixed to the level name, if you’re playing in editor. If you want it to always return the “true” level name, regardless of whether it’s PIE or not, use
FString LevelName = ()->GetMapName();
LevelName.RemoveFromStart(()->StreamingLevelsPrefix);