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

If statement Not equal to

I am trying to write an If statement like "If(IsBlank(field)" but I need it to be "If not = to "Select...""(field)"  How can you write something like that?  I want the action to run as long as the field value is not "Select..."

1 ACCEPTED SOLUTION

Accepted Solutions

Aha. You can usually put a “!” in front of your statement to make it a “NOT”.

Another option may be:
- Set the Submit Button DisplayMode Property to:

If(
Dropdown.Selected.Value = “Select”,
DisplayMode.Disabled,
DisplayMode.Edit
)

This is a type of manual error handling you can use for different things.
Coupled with some And() / Or() functions make it quite powerful.

View solution in original post

3 REPLIES 3
Memorable Member
Memorable Member

Hm.

 

Its tough for me to understand exactly what you are looking for here. But I'll try:

It sounds like you have a Textbox with "Select x" in it and you want to say,

If textbox.text has the string "Select x" in it, do something. 

If thats the case try:

If(
    IsMatch(textBox.Text, "Select x"),
    doSomethingCool,
    beLame
)

I tested this. It works. Here are the docs. When in doubt, consult Mr. Dang (a true treasure to the PowerApps community)!


@seadude wrote:

Hm.

 

Its tough for me to understand exactly what you are looking for here. But I'll try:

It sounds like you have a Textbox with "Select x" in it and you want to say,

If textbox.text has the string "Select x" in it, do something. 

If thats the case try:

If(
    IsMatch(textBox.Text, "Select x"),
    doSomethingCool,
    beLame
)

I tested this. It works. Here are the docs. When in doubt, consult Mr. Dang (a true treasure to the PowerApps community)!


Ok.  I am actually wanting a Patch to NOT run if the value of the dropdown = "Select..."  .  Is there an opposite of IsMatch?

 

This is part of a repeating table that I have designed.  The Patch will write values to my SharePoint list ('Revenue Pre-Defined Categories').  One of the fields in my repeating table is a dropdown and I dont want it to write to SharePoint if that dropbown has not been set to something other than Select.

 

ForAll(RevenuePreDefinedCollection, Patch('Revenue Pre-Defined Categories', Defaults('Revenue Pre-Defined Categories'), {Title: CategoryCC, AmountEach: AmountEachCC, Quantity: QuantityCC, Subtotal: SubtotalCC, MasterID: Form1.LastSubmit.ID}))

Aha. You can usually put a “!” in front of your statement to make it a “NOT”.

Another option may be:
- Set the Submit Button DisplayMode Property to:

If(
Dropdown.Selected.Value = “Select”,
DisplayMode.Disabled,
DisplayMode.Edit
)

This is a type of manual error handling you can use for different things.
Coupled with some And() / Or() functions make it quite powerful.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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