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 Pages / Setting regular expres...
Power Pages
Answered

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

(0) ShareShare
ReportReport
Posted on 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

Capture.JPG
Categories:
I have the same question (0)
  • Christian Leverenz Profile Picture
    1,214 on at

    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

  • CVO Profile Picture
    11 on at

    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 at

    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

  • Verified answer
    ragavanrajan Profile Picture
    7,044 Most Valuable Professional on at

    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.

     

  • Verified answer
    CVO Profile Picture
    11 on at

    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."

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
rezarizvii Profile Picture

rezarizvii 53

#2
DP_Prabh Profile Picture

DP_Prabh 40

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 28 Most Valuable Professional

Last 30 days Overall leaderboard