Smartforms - Can you make a field mandatory when selecting an action?

  • 22 March 2016
  • 9 replies
  • 0 views

Badge +6

I think I know the answer to this but: Can you make a field mandatory when selecting an action from the dropdown, just before submit?


9 replies

Badge +9

I just recently asked how to make a field conditionally required and used what I learned for this purpose.

 

If an advanced condition is true

  then show a message to the user

  then stop rule execution

 

11324i305B722C7811248F.jpg

Badge +6

Finally got around to trying this. It pops the message on the rule but allows the action to continue after hitting "ok" on the popup message even though the next step is the stop rule. Im missing something

Badge +9

Can you provide a screenshot of your rules?

Badge +6

13691iEC3711452F77D245.jpg

Badge +6

12927i5912A01AD214CA2E.jpg

Badge +9

You need to put your advanced condition BEFORE all the current worklist activity if statements to action the worklist item.

 

10852i39B3B35259B5C645.jpg

Badge +6

I have been working with K2 support on this as well. I had it setup where if the advanced condition was True then it would show a message Else complete everything else. This actually worked well without a stop rule. However I found out that if I did a check to see IF there was any text in the comment box it wouldnt work. Apparently you cannot have nested IFs in Smartforms.

Userlevel 3
Badge +8

Dear ,

 

Just read ur last comment and thought i should share a thing ,

its true u couldnt have nested if's in k2 , but there is a simple great work arround to acheive nested if's ,

all u need to do is to have 1 outter if condition , and inside that if u use "execute another rule" , the "execute another rule" will point to an UNBOUND rule ,

 

so the steps will be like ,

1-create unbound rule , unbound rule is if u add a rule without an "event" associated to it , and inside this unbound rule , add an IF condition ,

2-now u add ur IF condiion inside the specific event u need , and inside this IF  , use the "execute another rule" and call that unboud rule

in this way , u will have the outter if , and inside it u will call another rule (the unbound rule) which will execute the inner IF condition .

 

hope it helps!

regards.

Badge +9

Ahmad's suggestion is a good substitute for nested IF statements. I am using this approach as well.

Reply