cancel
Showing results for 
Search instead for 
Did you mean: 
Workflow Hero

Rules don't always seem to execute until after I save form

First off thanks to everyone who posts on this site.  I have been able to figure out a great of tricks based on your posts! 

One problem I am having is the timing of rules.  For instance, I have a form where one of the first fields is "Type" - based on the selection made in this Choice dropdown field, other fields become visible.  There are several posts on this site on how to make this happen, so I had no issues getting it to work.

I then wanted to do the same thing with a checkbox.  The rule does not seem to respect the selection made in the checkbox (I've tried setting it up as a Yes/No, Choice with checkbox option, even the built in yes/no in Forms)...  it does work, however, AFTER I save the record and reopen it (it seems the act of saving and then reopening triggers the rule and the field(s) become visible). 

I've now also run into a similar issue with lookup data (I look up a contract name from a second list, and also want to pull the expiry date from that same list based on the contract selected).  I found how to set up the control on this site, and if I hit save, when I reopen the record its there - but it does not appear "live", the way the fields respond when I have conditionally visibility based on a drop down.

Why do some controls/rules seem to execute immediately, and other require a save?  Is there a way to force it to happen right away?

I am on a current version of sharepoint online and Use Nintex Forms for Office 365 v. 1.2.4.1

0 Kudos
Reply
19 Replies
Workflow Hero

Re: Rules don't always seem to execute until after I save form

Hi Simon,

I assume by 'without saving' you're referring to having the new rule working in preview mode.

I've just created a new form (related to a blank list), thrown down some fields and tried a few different combinations and I can't find any that go unaffected by the rule (this is just in preview, I haven't saved). One for example is a Yes/No field that when ticked sets a text field to a certain value.

Would you be able to give me a specific combination you can't get to work as well as how you've currently got the rule configured?

Thanks,

Sam

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

Hi Sam,

Thanks for helping out with this.  When I say "without saving", I actually mean the record I'm adding using the nintex form after the fact.  I set up the form, I create the rule, and I Save and Publish the form.  Then when I go back to the Sharepoint list and click New, it displays the published form.  So far everything seems ok, but as I fill out the form, the rule based on the checkbox field does not seem to apply.  A different rule I have (using the exact same formula, but based on a choice drop down), works fine.  I'm confident the formula itself is fine as the one using a dropdown works, and also because after I save the record (taking me back to the sharepoint list), i can reopen that particular record and then the additional field is visible.  

I have included a screenshot of the formula:

In this case, the "AdditionalNotification" field is a Yes/No checkbox.  This particular rule is applied to a Recipient field which is obviously hidden unless the AddtionalNotification checkbox is checked (and hence = yes).  Again, if i check the box, and save the record, then reopen, it displays fine.  Its as if the rule doesn't recognize that the box has been checked until the data is committed to the sharepoint list (but again, if i change the AdditionalNotification to a choice dropdown, then it works fine when I select the appropriate choice).  

Hopefully that makes sense.  

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

Hi Simon,

I believe the problem here goes back to one of programming. Yes/No is a boolean value, so is represented internally by 1 or 0 (or in some cases true or false).

Testing your formula above with a yes/no checkbox I had the same issue as you even in a preview before saving/publishing.

Let me know if changing to the formula below resolves the issue:

AdditionalNotification!=true

Regards,

Sam

Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

I tried that previously as well...  but the same issue. 

I think the code is OK either way, its just not kicking into action right away.  Just to show that (and to ensure there wasn't anything weird going on with my column) I created a new yes/no column called Notification.  I set the default to No.  On the Nintex Forms, I added the field, and then on the Recipient(s) field set the rule "Notification!=true" then Hide the field.  

I then Published the form, and from my Sharepoint list clicked New.  

When I checked off the Notification checkbox, nothing appeared.  I hit save to add the new record to the List.

Then I immediately opened that same record, and voila, the Recipients field is there.  But why doesn't it show up as soon as I checked it off?

I think went back to the Sharepoint List settings and changed the Yes/No to a choice dropdown with the Choices Yes and No.  I updated the Form and republished, then clicked New on the Sharepoint list.   This time, as soon as i select Yes from the drop down it appears immediately.  

Now, one interesting thing I noticed - If the default value of the drop down choice column is Yes, the field will show when i click New to create a new record.  Even if I change it to No, the changes won't take effect until after I save and reopen (essentially the same behaviour as with the checkbox).  However, if I set the default value as empty/blank, then the form works exactly as expected, and as soon as i select Yes the Recipient field appears, and then when i change it to No, the field disappears.  

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

Yes / No controls return true / false, so you can actually write that formula as:


!AdditionalNotification

Which would be the same as saying:

AdditionalNotification !== true 

Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

Sorry to hijack this a bit but it almost sounds like you are using the the Column Reference in your Rule instead of the Named Control Reference. 

If the Rule you are running is only representing the state that would match what the Column's current value actually is (in sharepoint), then that is an indication that you need to reference the actual named control when you are setting up your rule. 


Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

I figured it out.  It finally clicked when I was writing that last reply to you.  I went back to my column list and changed the Choice to only one - "Yes" (I could probably keep the No option, but its somewhat redundant), then the key was to make sure the default value was blanked out (ie. no default answer).  

The rule remained as Notification!="Yes" with then "Hide" just as before.

This time it works fine. 

So I think I was missing the empty default value.  It needs to be blank. 

Earlier when i used the Yes/No checkbox column type, the default answer had to be either  Yes or No - it could not be empty.  So the default display was based on that default value.  But when I forced no default value, it responds correctly.

Thank you Samuel for all your help on this!  Walking through it all to explain it was what I needed!   

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

I was a little unclear about the difference between the Item Properties and Named Controls as I noticed the column named appeared in both.  Your explanation clarifies that - thanks!

I did try using both of these in the rule, but had the same result - unless I specified a blank default value, it doesn't seem to work until after the save.  

0 Kudos
Accept as Solution Reply
Workflow Hero

Re: Rules don't always seem to execute until after I save form

Gotcha.  I may play with that in the future...  but for now it works, so I don't wanna touch a thing!  Haha.

Thanks for you help!

0 Kudos
Accept as Solution Reply