Rule reverse: unSetFieldValue

Forums General discussion Rule reverse: unSetFieldValue

Viewing 1 reply thread
  • Author
    Posts
    • #27154
      Tricia S.
      Participant

      Hi I’m working with some rules and noticed that most actions that have reversibly but the Set field value doesn’t.
      A lot of the time I’m using rules to show/hide a field, as a result, the person filling out the form would set the field shown. Under some circumstances the person might file out those fields shown and at a later date that data is no longer needed.
      Currently I would have to write a second rule to ensure those fields that were hidden again have been cleared of data.
      I think a checkbox or similar list next to the set field value would be useful and cut back on rules.
      Basically “on reversal of rule, clear field value”.

      I’m currently up to 23 rules and I know they take loading time, so cutting back ion rules would be nice.

    • #27179
      Alexander Bautz
      Keymaster

      Hi,
      Unfortunately the rule reversing cannot unset values that you have set with setFieldValue. 23 rules is no problem, but if you have more complex needs it is often more effective to write some custom js to call from a rule – for example like this:

      function call_me_from_a_rule(){
        setFieldValue("Field_name_here", ""); // clears the field value
      }

      Alexander

Viewing 1 reply thread
  • You must be logged in to reply to this topic.