cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FlatFish
Helper II
Helper II

Display Labeltext if statement from button

Hi everyone, 

 

I am trying to have a warning type message when a button is clicked when an account action is not selected in a dropdown. My formula for the submit button is as follows: 

If(
    DropDown_Action.Selected.Result = Blank(),
    UpdateContext({labelText: "Please select an account action"}),
    If(
        DropDown_Action.Selected.Result = "Open",
        Navigate('Open Account'),
        If(
            DropDown_Action.Selected.Result = "Close",
            Navigate('Close Account'),
            If(
                DropDown_Action.Selected.Result = "Renew",
                Navigate('Renew Accout')
            )
        )
    )
)

I have a label's text field as labelText and there are no syntax errors in the function so I assume this is a logic error somewhere. 

FlatFish_0-1631891635173.png

Since there is no account action filled out I would like it to display, "Please fill out an account action"

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

Consider this:

If(
DropDown_Action.Selected.Result = Blank(),
Notify("Please select an account action"),
If(
DropDown_Action.Selected.Result = "Open",
Navigate('Open Account'),
If(
DropDown_Action.Selected.Result = "Close",
Navigate('Close Account'),
If(
DropDown_Action.Selected.Result = "Renew",
Navigate('Renew Accout')
))))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Consider Checking My Youtube Channel

 

View solution in original post

1 REPLY 1
eka24
Super User
Super User

Consider this:

If(
DropDown_Action.Selected.Result = Blank(),
Notify("Please select an account action"),
If(
DropDown_Action.Selected.Result = "Open",
Navigate('Open Account'),
If(
DropDown_Action.Selected.Result = "Close",
Navigate('Close Account'),
If(
DropDown_Action.Selected.Result = "Renew",
Navigate('Renew Accout')
))))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Consider Checking My Youtube Channel

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,276)