Skip to main content
Community site session details

Community site session details

Session Id : lw5ecpn1GLn051wRz1Se3s
Power Pages - Power Apps Portals
Answered

Setting regular expression on Entity Form Metadata for an Attribute causes required marker to appear when data is entered in to a field.

Like (0) ShareShare
ReportReport
Posted on 21 Dec 2021 13:39:47 by 11

I have a single line of text field on a portal Entity Form / Basic Form.  This field is not a required field.

I create an Entity Form Metadata / Basic Form Metadata record for the attribute. 

In the "Regular Expression" field I put in: ^[0-9]*$

In the "Regular Expression error message" field I put in: SEC must contain numeric characters only.

 

I open the form in the portal.  The field is blank.  It correctly does not have the red asterisk as the field is not required.

As soon as I type a value in the field, the red asterisk appears. 

When I remove the value from the field, the red asterisk magically appears.

 

Is this a bug?  Is it a "feature"?  Is it just happening to me?

 

Portals version: 9.3.11.12

  • Verified answer
    CVO Profile Picture
    11 on 17 Jan 2022 at 09:18:30
    Re: Setting regular expression on Entity Form Metadata for an Attribute causes required marker to appear when data is entered in to a field.

    FYI: Microsoft confirmed bug.  Hopefully be fixed in upcoming portal release.

     

    "With regard to the issue with the help of DEV team we were able to reproduce the issue on the vanilla portal on our side and also identified this as a BUG, our PG team is currently working on the fix for the issue and there is no exact estimated time as of now provided for the fix release."

  • Verified answer
    ragavanrajan Profile Picture
    7,036 Most Valuable Professional on 22 Dec 2021 at 23:06:27
    Re: Setting regular expression on Entity Form Metadata for an Attribute causes required marker to appear when data is entered in to a field.

    Hi @CVO 

     

    As @chleverenz  pointed out. It is a bug. You can raise a ticket to Microsoft and let's see their response. just in case if you want to get rid of the asterisk. (So Annoying) then below is the steps 

     

    In portal studio: 

    1. Add custom.css file and add the following CSS 

     

    #RegularExpressionValidatorcr5ce_lastname{ 
     visibility: hidden !important;
    }

    2. once done save> Sync config> Browse the website> Ctrl + F5 ( hard refresh) to hide the asterisk. 

    ragavanrajan_0-1640214356998.png

     


    Hope it helps. 
    ------------

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

     

  • Christian Leverenz Profile Picture
    1,214 on 21 Dec 2021 at 16:11:05
    Re: Setting regular expression on Entity Form Metadata for an Attribute causes required marker to appear when data is entered in to a field.

    Hi @CVO ,

    just checked it in one of my portals - same behaviour. But when i leave it empty and tab out, the asterisk is cleard 🙂

    so, seems to be a bug 😞

    Have fun,

      Christian

  • CVO Profile Picture
    11 on 21 Dec 2021 at 15:49:36
    Re: Setting regular expression on Entity Form Metadata for an Attribute causes required marker to appear when data is entered in to a field.

    Thanks for your response Christian.  Just to be clear, this is not about the Regex validation passing or failing on null values.  The Regex is working perfectly and is throwing a validation error when the form is submitted and the value does not produce a match on the Regex expression.

     

    This post is specifically about the red asterisk (or the required marker) appearing or disappearing on the non-required field whenever text is entered or removed in the field (and before the form is even submitted).

     

    The red asterisk is governed by the checkbox "Field is required" in the Entity Form Metadata record.  This is unchecked.  However, the field magically displays the required indicator in the portal as soon as text is entered in to the field.  This does not happen normally, and it appears the circumstances that lead to this happening are when a regular expression (of any sort) is entered in to the "Regular Expression" field in the Entity Form Metadata record.

  • Christian Leverenz Profile Picture
    1,214 on 21 Dec 2021 at 15:25:41
    Re: Setting regular expression on Entity Form Metadata for an Attribute causes required marker to appear when data is entered in to a field.

    Hi @CVO ,

    did not test, but may be null or undefined is passed in to the regexp and the test fails. 

    In case there are blanks in, may be this regexp helps: ^[0-9]*$|^\s*$ - in case of null i have no good idea, would be a bug...

    May be this points in the right direction,

      Christian

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 2

#3
surya narayanan Profile Picture

surya narayanan 35

Loading complete