Nintex Form 2010: make a manged metadata field mandatory


Badge +5

Hi,

I could not make a managed metadata field mandatory in the form using the IsEmptyOrNull({Self}) validation rule. How can this be achieved?

Regards,

Korak


8 replies

Badge +8

Well, for O365 users Managed Metadata in forms is still unavailable. Although it seems to be planned. Support for managed metadata – Customer Feedback for Nintex

I don't have On-Prem, so I could only suggest to make the managed metadata column required in the SharePoint list? That would seem to be the easiest approach - perhaps??

Badge +5

Thanks for your reply. I can't make the column required in the SharePoint list because I should be able to submit the form if this field is hidden.This is why I'm looking for a validation rule.

Badge +11

Hey Korak,

can't you use the standard Nintex Forms Control Settings for that field? Under "Validation" you can set this field as required, just like any other field. Otherwise please clearify why you cannot. I don't understand what you mean if you say you want to be able to submit the form if the field is hidden. How should your field be hidden and mandatory at the same time?

The normal configuration just produces what you wanted to achieve with the basic rule example mentioned above.

Regards

Philipp

Badge +5

Hi Philipp,

The field 'X' in question belongs to a panel. I'm hiding the entire panel if some conditions are satisfied. The requirement is that this field 'X' should be mandatory if and only if it is empty or null (which I tried to achieve using IsEmptyOrNull({Self}) but didn't work since it's a managed metadata field) AND the panel to which it belongs is not hidden.

Regards,

Korak

Badge +11

If the rule and the control settings aren't working for you, you would probably need to add some custom javascript. Unfortunately I haven't used panels yet and don't know how/if you can check if a panel is hidden. But maybe you don't need to check for the visibility of the panel. Since you are hiding the panel if some conditions are met, you can check for these conditions in your javascript.

You can write a java function for that and let the function return true if everything is fine and false if you field is empty although it needs to be filled. You can then put that function on your save button and it will execute your function before submit and only submit the form if the function returns true.

Badge +5

Thanks Philipp! This helps. I'm working on a JavaScript function but I'm not sure which property I should use to check if a managed metadata field is empty or not.

Badge +11

I'm not sure either. After some DOM inspection I maybe found some approach.

When the taxonomy field is empty, the DOM looks like thistaxonomy_empty.JPG

When the field is filled manually with an invalid value, the DOM looks like this:

taxonomy_filled_incorrectly.JPG

When the field is filled correctly, the DOM looks like this:

taxonomy_filled_correctly.JPG

As you can see, there is at least a slight difference in the DOM depending on the three possible states of your managed metadata field. So you could check for a correctly filled managed metadata field by checking if your DOM element representing the managed metadata field contains a span with the class "valid-text".

Hope this helps.

Regards

Philipp

Badge +5

Thanks Philipp! This is very helpful!

Reply