Clear value of a multi select field when another multi select field value changes - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Clear value of a multi select field when another multi select field value changes

Last post 05-15-2020 10:36 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-14-2020 08:30 AM

    Clear value of a multi select field when another multi select field value changes

    Hi, I use InfoPath 2013. I have 2 multi select fields. Practices multi select field has values: A, B, C Offerings multi select field has values: X, Y, Z - NOTE: This multi select field is hidden until C is chosen in Practices field. MY REQUIREMENT: If "Practices" = C, then "Offerings" show up and I select values in it. Next, if I select additional values in "Practices" along with C, the values previously chosen in "Offerings" should remain. If I uncheck C in "Practices", values in "Offerings" should be cleared MY ISSUE: I have set the Action rule on Practices field as this: Practices != SAP then set the Offerings value to blank. This is not working. If I select additional values in Practices, the Offerings values are getting cleared. If I uncheck C in Practices, offering is not getting cleared. Please help me fix the issue. Hope I am making sense of the above.
  • 05-15-2020 09:23 AM In reply to

    Re: Clear value of a multi select field when another multi select field value changes

    Multi-selects are different from other field types. They are bound to a repeating field. When you select an item, a new instance of that field is added to the underlying form data. When you unselect an item, that field is removed. InfoPath doesn't offer us any rule based way to add / delete fields, which makes this type of control very hard to deal with.... and then, also, I find that rules don't fire consistently from fields bound to this type of control, which is, I think, the issue you are describing. Is there any chance you could add this to your submit rules instead? If all occurrences of Practices are not equal to SAP, then set the field bound to the second multi to blank? I've attached a simple sample - You can see if you are changing the value in a repeating table text control, the rules fire consistently, but if you select in the multiselect control they don't. Save the attached file locally. Right click and select Design, then you can take a look at it, preview, etc.
    Hilary Stoupa

  • 05-15-2020 10:31 AM In reply to

    Re: Clear value of a multi select field when another multi select field value changes

    Thanks Hilary for the response. Yes, the rule is not firing when the value is unchecked in multi select field and the data is not getting cleared in the other field. To make this easy to understand, let us say, I have a multi select field and a text field. Multi select field has SAP, Oracle, Testing as values. I choose SAP, and enter data in the text field. Now, I choose additional value in multi select field, the data in text field should remain. Next, I uncheck SAP in multi select field. Then, the text field should be cleared. This is not working. See attached file. Maybe, I should not use clear rules on multi select fields. Wish that was a possibility.
  • 05-15-2020 10:36 AM In reply to

    Re: Clear value of a multi select field when another multi select field value changes

    Right - that is what I was saying. The rules on a field bound to a multi-select won't run when you anticipate. I think it is because when you deselect, it is removing the node, not just clearing the field. I think using the rule on the field bound to the multi-select is not going to work, which is why I suggested an alternative - If you look at my sample form, I've got a button that clears all instances of the second multi-select if no instance in the first is equal to "c". I honestly don't think you are going to be able to do what you wish with the multi-select control.
    Hilary Stoupa

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.