locked
Setting a rule based on the action of checking and unchecking a box RRS feed

  • Question

  • I have a form where certain checkboxes are assigned a points system. Example: if field 1=True add 1 point to "points Total" field, subtract a point if Field 2=true. 

    I have the rules set up for that situation, but I run into a problem where a user can check a box (thus adding the point) and if he unchecks the same box, that point remains. He can then keep adding points by re-clicking that box.

    Is there a rule that can say "if field 1 goes from "false" to "true" add 1 point but if field 1 goes from "True" to "false", subtract 1 point. I hope this makes sense.

    Thank you

    Tuesday, December 6, 2016 9:13 PM

Answers

  • Hi Duke,

    A Simple workaround is to hide the total points from the initial form and to add the rules to the button( Button with rules and custom code action) instead of adding the rules to checkbox itself. Then, you can show the Total Points in next view by using Switch view rule in button


    Regards, Sathiya

    • Marked as answer by Dukefan3417 Thursday, December 8, 2016 7:33 PM
    Wednesday, December 7, 2016 6:23 AM

All replies

  • Hi Duke,

    A Simple workaround is to hide the total points from the initial form and to add the rules to the button( Button with rules and custom code action) instead of adding the rules to checkbox itself. Then, you can show the Total Points in next view by using Switch view rule in button


    Regards, Sathiya

    • Marked as answer by Dukefan3417 Thursday, December 8, 2016 7:33 PM
    Wednesday, December 7, 2016 6:23 AM
  • Hi Sathiya,

    Sorry, I'm a bit of a self-learner in infopath/SharePoint. Are you saying to put all of the rules in the submit button? Basically after hitting submit, the button would tally up all of the points?

    Edit*** I actually got it to work by having the button reset the field first, then adding (or subtracting) each point and then submitting and closing. Works perfectly! Thanks! I never would have thought to tally it all at the end with a button!
    • Edited by Dukefan3417 Thursday, December 8, 2016 7:33 PM
    Thursday, December 8, 2016 3:28 PM