cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
eric_beeler
Nintex Newbie

Rule for requiring a dropdown to be selected

Jump to solution

I am trying to make an Approval Status dropdown box required to be filled out. I have created a rule for this

and(isNullOrEmpty({Self}), not(equals({ItemProperty:Form_x0020_Status}, "Creation")))

but I am not sure why it is not working. I only want the Approval Status to be required, if it's not in the Creation form status. Once someone submits a form, I want a manager to go in and change the Approval Status but right now it is not being required.

Here is what the form looks like below:

Tags (2)
Reply
11 Replies
emha
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

is it NEW form?

if so, item fields are not populated in NEW form yet, just after you submit the form.

Reply
eric_beeler
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

No, the Associated Template and Approval Status fields show up after it has been submitted. The above view is what the manager would see when they go in to approve or deny the request.

Reply
emha
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

so is it task form?

what's datatype of FormStatus field (text, choice, lookup ...)?

how/where do you populate value to the field - form/workflow?

have you checked it really contains value you expect?

have you test rule in preview or in runtime?

Reply
eric_beeler
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

I'm a little confused on what you mean if it's a task form or not.

The Approval Status dropdown is a Choice and I have my three choices in the list: Approved, Denied, Cancelled. As seen below

Yes, the field does have data in it.

The strange thing is, I have the same rule setup for Associated Template to be required as well but this one is working correctly, while the Approval Status one is not making it required. I have tested this. See the below:

0 Kudos
Reply
emha
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

I'm a little confused on what you mean if it's a task form or not.

task form = form configured within workflow's task action (flexi task, request review, etc)

The Approval Status dropdown is...

sorry, I asked for datatype of FormStatus list field - the one used in validation formula.

  I have the same rule setup for Associated Template

is it one rule assigned to two form controls, or are they two rules, one for each control but with same/similar validation formula?

have you copied the formula over?

are you sure the validation message for associated template control comes from validation rule? it looks much like some default message, eg for mandatory columns.

0 Kudos
Reply
eric_beeler
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

No, it is not a task form. The rule is not applying on the EDIT form of the list template.

Form Status is a Choice field which defaults to Creation. After the form is submitted, a workflow runs and changes the value to Submitted. So we are trying to get certain fields to only be required AFTER the form has been submitted the first time.

There are two separate rules, however, the validation formula is the same for both. To clarify, I have the following formula used in a validation rule on our Associated Template and Approval Status fields:

and(isNullOrEmpty({Self}), not(equals({ItemProperty:Form_x0020_Status}, "Creation")))

This formula is working in our validation rule on Associated Template, which is a List Lookup. However, this formula does NOT work in our validation rule on Approval Status, which is a Choice field.

Yes, I verified the message is coming from the validation rule and is not the default message.

As you can see in the picture above, I added "!!!" to the end of the message.

0 Kudos
Reply
emha
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

ok, let's try following

- place 6 calculated value controls on the form and set their formulas as follows (create all the formulas with formula builder, do not copy them over from this post nor among single formulas!)

- ApprovalStatusControl (named control)

- isNullOrEmpty(ApprovalStatusControl)

- {ItemProperty:Form_x0020_Status}

- equals({ItemProperty:Form_x0020_Status}, "Creation")

- not(equals({ItemProperty:Form_x0020_Status}, "Creation"))

- and(isNullOrEmpty({Self}),not(equals({ItemProperty:Form_x0020_Status},"Creation")))

0 Kudos
Reply
eric_beeler
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

I tried the 6 calculated value controls you provided above. The 5th one in order does not seem to work. Below is snapshot of the formula I used and the second snapshot is the preview of it that does not provide a value.

In the picture below, we cannot use "Self" under Named Controls since it's not in the list. We can use this function under Rules but don't think it's available under Calculated Values.

0 Kudos
Reply
emha
Nintex Newbie

Re: Rule for requiring a dropdown to be selected

Jump to solution

I think it's 6th formula that gives value error. first one gives no output so you can not see it - try to enable borders for single controls and you will see that.

sure you can not use {Self} in calculated value control, I've just forgotten to replace it wih ApprovalStatusControl.

so the formula should look like

and(isNullOrEmpty(ApprovalStatusControl),not(equals({ItemProperty:Form_x0020_Status},"Creation")))

from the results I see evaluation works correctly.

your testcase is for FormStatus=='Creation', result of overall formula is FALSE, ie. form is valid and form submit passes through.

if you tested for different FormStatus, overall formula would evaluate to TRUE hence form is invalid and you get validation error as per your requirement.

0 Kudos
Reply