cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JohnJStraumann
New Member

Set Label

Hello all:

 

Working on a very simple login form by following online tutorials, and simply want to set a label status message to an error if the entered Password is incorrect. So I have text inputs: username, Password, a Submit button, and a Label named LabelStatus I tried to enter formulas in the Button action:

 

f (Password.Text= "Hello", Navigate(HomePage, ScreenTransition.Fade),Set(LabelStatus.Text, "Incorrect Password"))

f (Password.Text= "Hello", Navigate(HomePage, ScreenTransition.Fade),LabelStatus.Text="Incorrect Password")

 

and also tried a variable, but no joy. Can anyone offer a suggestion?

 

Kind regards,

 

John.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @JohnJStraumann ,

 

Have your issue been resolved? If not, I'm happy to help further.

 

Was the Text property of Label set to "varStatusMessage"?

If you want to reference the variable, there is no need to wrap the variable name around the double quotes in Text property of Label. Just try to set the Text property to varStatusMessage.

 

Hope this helps.

Sik

View solution in original post

3 REPLIES 3
mdevaney
Super User III
Super User III

@JohnJStraumann 
Put this code in the OnSelect property of your login button.

 

If(
    Password.Text= "Hello",
    Navigate(HomePage, ScreenTransition.Fade),
    Set(varStatusMessage, "Incorrect Password")
)

 

Then put this code in the Text property of LabelStatus.

 

varStatusMessage

 

 

Hopefully this works for you.  I would also like to point out though that the user has already logged-in using their Office 365 credentials to access the app.  A 2nd login is not really needed here.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Thank you very much for your reply, unfortunately it did not work (see screens).

 

Thank you for the information about the Office 365 creds, it DOES make the Login screen redundant, but I'd still like to make it work as an exercise.

Hi @JohnJStraumann ,

 

Have your issue been resolved? If not, I'm happy to help further.

 

Was the Text property of Label set to "varStatusMessage"?

If you want to reference the variable, there is no need to wrap the variable name around the double quotes in Text property of Label. Just try to set the Text property to varStatusMessage.

 

Hope this helps.

Sik

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,305)