Dynamic dropdown lists and rows within a repeating table - InfoPath Dev
in

InfoPath Dev

Dynamic dropdown lists and rows within a repeating table

Last post 11-25-2019 12:28 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 11-25-2019 10:16 AM

    • gclode
    • Not Ranked
    • Joined on 06-20-2019
    • Posts 8

    Dynamic dropdown lists and rows within a repeating table

    I am attempting to build out an InfoPath form with a repeating table that is dynamic and I was curious to see if what I wish to accomplish is possible as I have not been able to find an answer anywhere. I have a form with a drop-down with the choices A, B, and C. This is not in the repeating table. Then one field in the repeating table is called REPORT, this is the one I would like to be dynamic. What I would like to have happen is if a user selects A then the drop-down list only shows the items for the "A" source in the drop-down. If they select B then only the "B" sources are listed in the drop-down, etc. The second thing, and this may not be possible, would be to have the repeating table then dynamically add the correct number of rows based on the number of items in the source list. So if the source selected was A and A has 30 items in it, then 30 rows are displayed in the table. In a perfect world, each row would already have the dynamic drop-down pre-fill with each unique item in the source list. This could be a text box as well if they are able to be filled in automatically. So the end result would be a repeating table that adds the matching number of rows based on the number of items in the source as well as fill in each REPORT field within each row with the unique values from the source. I hope this made sense, and it may be too complex for InfoPath to do, I figured I would ask before I find a work around. Thanks!
  • 11-25-2019 12:28 PM In reply to

    Re: Dynamic dropdown lists and rows within a repeating table

     For the first part, I'd use an XML file (or a SharePoint List) for the data source for the dropdowns. Then you can add filters to the dropdown in the repeating table to only display the matching items. If your dropdowns have hardcoded values, this isn't possible. So - if you are using SharePoint already, maybe just create a simple list with two columns, Title and ReportType (for example) - ReportType would be A, B, C. In your form, the Report dropdown uses values from the ReportType column (select the option to only display unique items) and then in the repeating table dropdown, you can filter the options based on the Report type selection.

    For the second part - you can sort of do this without code if you use default data. That involves adding the max number of rows you expect to have to your repeating table and using conditional formatting to hide the ones you don't need. Here's a video that outlines this (among other techniques):  https://www.youtube.com/watch?v=W4ukzlaQBpM

    Hilary Stoupa

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