Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Unanswered

Conditionally setting fields to mandatory - Issue

(0) ShareShare
ReportReport
Posted on by 309

We followed the code as per post -

Solved: Conditionally setting fields to mandatory - Power Platform Community (microsoft.com)

 

This works fine and we are able to show/hide a single text field (and also make it required) when another field is set to "Other" -

 

prathyoo_0-1715107333915.png

prathyoo_1-1715107370937.png

prathyoo_2-1715107432438.png

 

This is fine so far. But then I realized that since this is only a client side JS, this can of course be overidden. 

 

I ran the following in the console and yes, the validation has disappeared. We run it multiple times until Page_Validators is emptied.

for (i = 0; i < Page_Validators.length; i++) {
					Page_Validators.splice(i, 1);
					}

 

prathyoo_3-1715107536043.png

On the other hand, if we use form metadata to make a field required, it not only adds to the page_validator but also checks at the server side.

 

Hence, we would like dynamic validations but at the server side. In our project we have done a lot of different client side javascripts based on recommendations from the community but we feel that is a big area of concern.

 

 

Categories:
  • Fubar Profile Picture
    7,964 Super User 2025 Season 1 on at
    Re: Conditionally setting fields to mandatory - Issue

    For server side you would have to write them in Plugin code, or could use realtime Workflow's for very simple stuff.  If you do this you also need to set the site setting below to true, and in your plugin error output/throw a 'nice' message, (for Workflow Stop step as error with nice message) 

    Site/EnableCustomPluginError set to true

       

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 > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43