Tip #1327: Validators on user profile pages in Power Apps portals

&tl;dr

For a custom validator to work on a user profile page, the validator must have validationGroup set to “Profile“.

I’m trying to apply custom JavaScript validation on Profile Page but it acts like it ignores any of my script validation. Adding trace shows the custom JavaScript code is added but I never entered custom validation logic (like webFormClientValidate function or Page_Validator validators collection). Anyone?

Tanguy “The XRM Toolbox” Touzard

Colin “Portal Keeper” Vermander explains why it’s a challenge:

The profile page is still an aspx page and might be harder to hook into. You can change it to a web template with a standard entity form and then you can do what you like normally.

Jim “Actully James” Novak couldn’t help himself to dig deeper:

I just tested with a simple null validator on the job title field. I see that the validator in the Page_Validators array, but its not being called! So must be the custom aspx not working the same as entity / web forms. 

Solution

And finally, Tanguy helping Tanguy:

Found it! I had to specify the same validationGroup in my validator, which is “Profile” for the profile page. (tj – Once the group is specified, the validator kicks in as usual).

Leave a Reply

Your email address will not be published. Required fields are marked *