web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : HXa8OZvDKpxcUZL+kA3eeg
Power Pages - General Discussions
Unanswered

Conditionally setting fields to mandatory - Issue

Like (0) ShareShare
ReportReport
Posted on 7 May 2024 18:51:05 by 311

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
    8,032 Super User 2025 Season 2 on 07 May 2024 at 22:14:41
    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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

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!

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