# Problem with inputing Text from UMG Widget to C++

**URL:** <https://forums.unrealengine.com/t/problem-with-inputing-text-from-umg-widget-to-c/353851>\
**Category:** Blueprint\
**Tags:** fstring, FText, unreal-engine, functions, Blueprint, question, CPP\
**Created:** [April 12, 2016, 6:41am UTC](https://forums.unrealengine.com/t/problem-with-inputing-text-from-umg-widget-to-c/353851 "2016-04-12T06:41:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_ac4731691](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_ac4731691](https://forums.unrealengine.com/u/anonymous_user_ac4731691)\
**Post date:** [April 12, 2016, 6:41am UTC](https://forums.unrealengine.com/t/problem-with-inputing-text-from-umg-widget-to-c/353851/1 "2016-04-12T06:41:53Z")

</div>

Hi, I must be missing something here. I’ve created a test blueprint function to get a login system figured out and it doesn’t seem to be calling my username/password inputs right. It just goes false every time, even if I type user/pass which should return true and go to the next level. I have a feeling it has something to do with how the GetUserLoginData function is taking in the FStrings.

```
//Header FIle
UFUNCTION(Server, BlueprintCallable, Category = "Database")
bool GetUserLoginData(FString username, FString password);

//cpp File
bool ULoginMain::GetUserLoginData(FString username, FString password) {

	FString user = FString(TEXT("user"));
	FString pass = FString(TEXT("pass"));

	if ((username == user) && (password == pass)) {
		return true;
		
	}
	else {
		return false;
	}
}

```

 ![86444-bptest.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/b/42bd0a698d4b0ca14203e6cd651bd69c46d4d6ce.jpeg)

 ![86443-capture.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/1/8/01800ca2dce7e4148156aebf17517af96e810421.jpeg)

---

<div class="post-metadata">

**Author:** ![Aaron1178](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Aaron1178](https://forums.unrealengine.com/u/Aaron1178)\
**Post date:** [April 12, 2016, 8:59am UTC](https://forums.unrealengine.com/t/problem-with-inputing-text-from-umg-widget-to-c/353851/2 "2016-04-12T08:59:17Z")

</div>

Try changing this

```
 FString user = FString(TEXT("user"));
 FString pass = FString(TEXT("pass"));

```

To this:

```
 FString user = "user";
 FString pass = "pass";

```

You also have the following available, using FString.Equals():

```
if( username.Equals(user) && password.Equals(pass) )
{
    return true;
}
```
