How To Show a Custom Valid If Error Message

You’ve been working long and hard to get your Valid If formula correct, and finally it’s doing what it’s supposed to - preventing duplicates, wrong info, bad dates, etc. from being entered by your users.

But now you want to go a step further and provide the user with some info about WHY the data they entered is invalid.

This is where the “Invalid value error” field comes into play.

3X_4_8_48329d4e45a94128bdf968df74def62ea0261a3e.png

Utilizing this features is extremely easy, due to the fact that most the hard work has already been done when you completed your Valid If formula.


All you need to do is:

  1. Copy the formula you’ve got for your Valid if,
  2. Reverse is; and
  3. Insert it into an IFS() statement
    • along with whatever actual error message you want to show to the user.

Example

Let’s say I’m preventing users from entering the same [User_Name], and I have a Valid If formula of the following:

NOT(IN([_THIS], SELECT(Users[User_Name], [UserID] <> [_ThisRow].[UserID])))

Once I go into the form, and enter something that's already inside the table, I'll receive the default error message.

To create a customized error message

I’ll take the formula inside the Valid If, add it to an IFS() formula (as the condition) - reversing the logic - and add in my error message.

Here’s what my formula looks like when I’m done

IFS(IN([_THIS], SELECT(Users[Users_Name], [UserID] <> [_ThisRow].[UserID])),
  "This name is already in the system"
)

Here’s the process and what the behavior looks like in the end

10 3 2,701
3 REPLIES 3

I had to add ISBLANK([_THIS]) to display the column input box in the form. Here the condition is different the Email Input has to be in the Table Users,.

Only the first expression is working. The second expression is not working expression. Can you tell where I made a mistake? 

 

 

IFS(IN([_THIS],SELECT(CAMPUS SCAN SHEET[AWB NO],[AWB NO]=[_THIS].[AWB NO])),"Already Scanned This Shipment"),Not(OR(

  CONTAINS([_This], "CRP"),

  CONTAINS([_This], "~"),

  CONTAINS([_This], "`"),

  CONTAINS([_This], "!"),

  CONTAINS([_This], "@"),

  CONTAINS([_This], "#")

  CONTAINS([_This], "£"),

  CONTAINS([_This], "€"),

  CONTAINS([_This], "$"),

  CONTAINS([_This], "¥"),

  CONTAINS([_This], "%"),

  CONTAINS([_This], "&")),"Re-scan AWN No")

The example used here is a bit confusing since the [TableID] is the same as the column that is being checked. I had a working Valid IF formula but I started question it when I couldn't get this to work. Here's the formula so you don't have to leave this page to check your work:
Not(In([_THIS], SELECT(Table[Column_Name_for_THIS_Column], [TableID] <> [_ThisRow].[TableID])))

Top Labels in this Space