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 / Regex Field Validation...
Power Pages
Unanswered

Regex Field Validation not working in Entity Form

(0) ShareShare
ReportReport
Posted on by 22

Hello all,

 

I have set up an entity list with an entity form for editing CDS records. In the entity form metadata I have set up a regular expression for preventing numbers in street names. However, when I submit the form, the validation does not seem to work since it accepts "123" as street name. Have I missed a setting? My regex is ^[a-zA-Z]+$ , Field is require.

 

Thank you!

 

regex.PNG

Categories:
I have the same question (0)
  • justinburch Profile Picture
    Microsoft Employee on at

    Hi @jandersen,

    Have you made certain this is pointing to the right field? Your RegEx worked without issue for me.

    Additionally, please make sure you have reset the cache. You can find some tips on working with the cache here: https://justinburch.com/cache-tips/

  • jandersen Profile Picture
    22 on at

    Hi @justinburch , thanks for the hint. Unfortunately clearing the cache did not solve the issue. Regarding your question if the metadata is pointing to the right field: I think it is, at least edits to the description & labels are reflected in the Portal. Are there any other settings that may be necessary?

     

    metadata.PNG

  • justinburch Profile Picture
    Microsoft Employee on at

    Thanks for the clarification, @jandersen. That's definitely odd, if the label change and all is reflecting then you're definitely using the right one. I didn't have to do anything further for mine - I just made sure it was a text field and added the same RegEx, then as soon as I click "Submit" it shows my custom message once violated.

    Are you able to try the same RegEx against a different field - maybe one with no other entity form metadata - to see if it works there? Maybe on a different entity form?

  • jandersen Profile Picture
    22 on at

    @justinburch, I set up a new form for the Contacts entity and used the same Regex validation for the job title field, and it works. Maybe there's something wrong with my custom entity but I can't find the cause. Since it's just a test environment I won't bother investigating further. Thanks for confirming that I didn't overlook anything :).

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 41

#2
Valantis Profile Picture

Valantis 23

#2
omkarsupreme Profile Picture

omkarsupreme 23

Last 30 days Overall leaderboard