Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields) - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

Last post 02-24-2016 05:00 PM by Hilary Stoupa. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 01-10-2016 07:34 AM

    Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    Hi,

    Apologies if this has been covered elsewhere. I did a search and although found a few simialar posts, could not see one which touches on this kind of scenario.

    I have three cascading dropdowns, all reading from a sharepoint data source and with filters set up to only show available options dependant on what the user has selected in the previous filter, so in essence one each dropdown dictates what is available in the next.

    Example Below

    Example 

    What I am trying to achieve is this;

    While making sure each field remains mandatory, where the a top dropdown or 2nd level dropdown may not have any further items linked in the remaining dropdowns, when selecting such a field I am looking to auto-complete the remaining dropdowns with N/A or the same value as the previous level and hiding the control so the remaining dropdowns so the user can continue with the form. Hiding it once the first field is selected and the next ones will be the same or N/A just looks more professional.

    What I am trying to avoid is having a user first selecting dropdown 1, finding the next two levels with N/A or the same name and because the field are mandatory, the user must click through the two remaining dropdowns before they can continue. I can get this to work without mandatory switched off but not with it on.

    I know how to add a rule to add any text if field one matches for example "Main Job 3" but keep getting the Infopath error in Sharepoint when doing it this way. Not sure if I can set a rule which looks at filter one and dependant on what the user selects, looks up the same value in the sharepoint source data and auto selected the same dropdown and accepts the fields as being completed. 

     Any suggestions would be welcomed :)

    Thank you advance

  • 01-13-2016 10:31 AM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

     Hi,

    Please forgive me, just hoping there is someone out there who can provide some guidance on my issue or how best to approach? This would have been far simpler if I did not have to set these dropdowns do not have to be filled as mandatory.


    Filed under:
  • 01-13-2016 12:36 PM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    Hi, instead of setting the field as cannot be blank, use custom validation. Then you can add a validation rule like "if field 1 is not blank and if there are items in my secondary data connection that populates the dropdown for field 2 that match the selection in field 1, field 2 can't be blank" - sorry, that sounds clunky. I'll try to work up a simple sample later today for you.
    Hilary Stoupa

  • 01-13-2016 05:10 PM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    I've attached a simple sample with custom validation - for the first drop down, you'll see the second is not required if you select "Bagels". Save the linked file locally, right click, select design and from there you can preview.
    Hilary Stoupa

  • 01-17-2016 08:34 AM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    Hi Hilary,

    It worked a charm. Cannot thank you enough!. Always amazes me having a second person looking at a problem can make you look at it differently and simplify a problem. 

    Again, much appreciated!

  • 01-18-2016 07:45 AM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    Wonderful, glad you have it working! :)
    Hilary Stoupa

  • 02-24-2016 11:46 AM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    Hello! 

     I'm replying here because this is almost exactly what I am trying to accomplish.  However,  my knowledge of how to get to this point is more limited, unfortunately.  I am creating a trouble ticket request form for a group of coworkers.  The first field would be the type of system they are having difficulty with and the second would be dependent on the first and give options for their problem description based on the specific system, i.e., 

    (**)The System options may be SharePoint, Outlook/Email, Call Tracker, Dialer, Hardware/Computer, etc. Then the next question will offer the person filling out the form separate options based on the selection in the first questions i.e. if they chose outlook/email they will be offered the options: I can't connect, won't download email, can't send email, etc. If they select Hardware/Computer they may be offered the options: Screen frozen, Order New Device, Please Provide in person assistance, Need New Desk phone, need new headset, etc.

    I see the bones of how this is setup in your example above - but am unsure how to set up the data source and entries, etc.   

     

    Any Assistance would be appreciated!!!  If I should post in a new thread about this I'd be happy to do that.

     

  • 02-24-2016 12:09 PM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    As I research, I think one of my first issues is that I don't know how to create an XML file to populate the options from or where to store it since this form will be used be a variety of users inside a closed network. 

  • 02-24-2016 05:00 PM In reply to

    Re: Auto-Populating a Dropdown based on another Dropdown (Both Being Mandatory Fields)

    You can create an XML file in a text editor and add it as a resource to the form. If you look under the data tab in the ribbon on sample and click on resource files, you can export the XML file that is used and take a look at it in a text editor like Notepad. I use NotePad ++ (free) with the XML plugins to create XML usually - it has some nice autocomplete and validation stuff. :)
    Hilary Stoupa

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