Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Validation of text input in the form

(0) ShareShare
ReportReport
Posted on by 6
I have border thickness property set to (see below) and it works fine but it also gets activated when I preview the app. How to avoid this?
 
If(
    !IsMatch(DataCardValue3.Value, "^[A-Z]{3} [0-9]{3}[A-Z]$"),
    3,
    1
)
Categories:
  • Verified answer
    stampcoin Profile Picture
    2,133 on at
    Validation of text input in the form
    Assume that when preview, the text is empty.
    Power Apps will treat a blank (“”) input as non‐matching, so the thicker border (3) shows up immediately—e.g. even when you just hit Preview and haven’t typed anything yet.
    consider below code ( as your reference), 
    If(
        IsBlank(DataCardValue3.Text),
        1,                              /* default border when empty */
        If(
            !IsMatch(DataCardValue3.Text, "^[A-Z]{3} [0-9]{3}[A-Z]$"),
            3,                          /* invalid pattern → thick border */
            1                           /* valid pattern → normal border */
        )
    )
     

    Enjoy Power Platform and have a great day 🚀 |  My LinkedIn

    If the answer helps, please consider 👍, Thanks.

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics