web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / PowerApps Form Validat...
Power Apps
Answered

PowerApps Form Validation -- OnSelect formula not working

(0) ShareShare
ReportReport
Posted on by 5

Hello. I'm having trouble with a validation formula and I'm not sure why.

 

I'm using a Canvas Power App on my SharePoint Online list. I have a column "A" that is single line of text. I have another column "B" that is a choice, dropdown column. Column A contains a single word/single line of text. Column B choices are strings of text in a dropdown. When a user makes a choice in column B, I need a formula that will check Column A to see if the choice in B contains the word in column A. 

 

If so, I do not want the user to be able to submit the update to the form. The formula I have tried is in the property OnSelect of my Submit button and reads: 

If(Not(IsBlank(Find(DataCardValue3.Text,DataCardValue5.Selected.Value))),Notify("Invalid choice",NotificationType.Error)SubmitForm(SharePointForm1))

 

But the result is I'm able to submit my form even when my column B choice contains the word in column A.  What do I have wrong here? Thank you in advance for your insights. 

Categories:
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @CristinaM,

     

    You could try to use the in operator instead of the current code:

    If(
     Trim(DataCardValue3.Text) in DataCardValue5.Selected.Value,
     Notify("Invalid choice",NotificationType.Error),
     SubmitForm(SharePointForm1)
    )

     

    With the Find function 2 issues could occur:

    • When using the wrong case in column A ("A" will not be found in the string "a")
    • When adding a space at the start or end of column A ("a " or " a" will not be found in string "a")

    Issue one is fixed by using the in operator which is case insensitive. The second issue is fixed by using the Trim() function around the Column A text input.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • CristinaM Profile Picture
    5 on at

    Perfecto! Thank you, @LaurensM,  so much. Had a chance to finally try it today, and it works like a charm. 

    Appreciate it. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard