Remove item from a list of choices after it has been selected. - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Remove item from a list of choices after it has been selected.

Last post 08-30-2018 08:01 AM by Hilary Stoupa. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 08-21-2018 01:26 PM

    Remove item from a list of choices after it has been selected.

    I didn't know how to search for this. I need to have 22 individual controls that can select from the numbers 1, 2, 3, 4, 5, 6, 7 and 8. As each of these numbers are selected by one of the controls, I would like the number removed from the pool of choices available. So yes, many of the controls will not have a number available, this is okay and intentional. I'm not sure what control to use to make the selection and I don't know how to create the pool of choices. Any ideas?
    Filed under:
  • 08-27-2018 09:09 AM In reply to

    Re: Remove item from a list of choices after it has been selected.

    Oh interesting. I think I'd use a repeating structure for this, if you weren't already planning on that - under Data in the ribbon, find the default data option and you can insert additional instances of a repeating group so that you can default to having 22 available. I'd probably use a dropdown for the selection of the number, and I would use an XML secondary data source to provide the options. Then I'd use conditional formatting to show / hide only numbers that haven't been selected. I'm attaching a sample form. Save it locally, right click and select Design and from there you can preview and try it out. I only added a couple of numbers for the options and 5 instances of the group, but it should give you the general idea. :-)
    Hilary Stoupa

  • 08-27-2018 08:54 PM In reply to

    Re: Remove item from a list of choices after it has been selected.

    Hilary, Thank you for the response. Your example works exactly how I envisioned it. Unfortunately, I'm nowhere near knowledgeable enough to take what you have and adapt it to my need. The 22 controls have to be placed in very specific locations within a table and therefore are not able to be in a repeating section or table as in your example. I currently have these controls in the table as dropdown list controls. They select from the numbers in a list as you suggested, although the numbers are not removed from the list as in your example. It appears that since the dropdowns are not in a repeating section, the expresion you provided in your example will not work. Is there a way to do this without the dropdown being in a repeating section?
  • 08-28-2018 08:03 AM In reply to

    Re: Remove item from a list of choices after it has been selected.

    Yes, it is just a bit more tedious. First, your values can't be hardcoded in - you'll need to use secondary data source like my example (probably XML is the easiest). Then your filter has to specify each field. Feel free to attach a sample if you'd like a hand - you can attach a form under the options tab in a reply.
    Hilary Stoupa

  • 08-28-2018 10:37 PM In reply to

    Re: Remove item from a list of choices after it has been selected.

    Well, my form is too big to attach here. So maybe you can describe what you mean by 'Then your filter has to specify each field.' When I tried this before I modified the filter like this: not(. = current()/preceding-sibling::my:groupLinear/my:field928) not(. = current()/following-sibling::my:groupLinear/my:field928) field928 is one of the dropdown controls. Are you saying that I need every other field listed in each one of these filters or that each filter has to have the local dropdown control's name?
  • 08-30-2018 08:01 AM In reply to

    Re: Remove item from a list of choices after it has been selected.

    If you are not using repeating data you won't need to use preceding or following sibling. You just have to filter out each field individually.
    Hilary Stoupa

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