Repeating table rows with local fields based on number of rows from list? - InfoPath Dev
in

InfoPath Dev

Repeating table rows with local fields based on number of rows from list?

Last post 09-11-2019 11:52 AM by Hilary Stoupa. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 09-09-2019 06:37 AM

    Repeating table rows with local fields based on number of rows from list?

    I'm trying to build a form in which a user selects a topic and then a subtopic which then displays a list of questions (filtered by the former).  Those are 3 columns in the SharePoint list connection, however we want to collect answers for the questions which will then be stored in the form library which, as far as I know, requires the use of a "local" repeating table as it requires fields for storage upon submit.  The problem is that the number of questions changes and thus the number of rows displayed by the repeating table.

     What I've been trying to do (and failing at) is to have the list connected repeating table showing the questions side by side with the repeating local table for answer collection.  It's clunky but it works in that we can collect the answers if the user adds rows but that's certainly not ideal.  I figured we would have a way to dynamically adjust the number of rows shown based off the count of rows on the list connected repeating table (which I have using count function on the filtered question column).

     Is what I'm hoping to achieve possible?  Can anyone see an alternative method (codeless ideally)?

     Thanks!

  • 09-09-2019 08:40 AM In reply to

    Re: Repeating table rows with local fields based on number of rows from list?

    You actually have to either already have or create the number of rows you need in the form. This video has a default data technique that does this - https://www.youtube.com/watch?v=W4ukzlaQBpM. Basically, you insert more rows than you need, hide the blanks, and use some form logic to set the values. If you have a general idea of the max number of questions you might have, it could be a good approach for you.
    Hilary Stoupa

  • 09-11-2019 11:44 AM In reply to

    Re: Repeating table rows with local fields based on number of rows from list?

    Thank you Hilary!

    The method in the video was a bit more complicated than I could handle but your suggestion was perfect for our needs.  I was able to set an absurd amount of default rows that should never be reached (and if it is we'll expand it), added a row number field using the formula "count(preceding-sibling::*) + 1", made a field to count the number of rows on the list connected repeating table (filtered by subject column so this changes based on selection) and using conditional formatting to hide any rows greater than the list repeating table row count.  Both repeating tables are in a 2 column table with fixed height rows to provide the illusion of a single table!

     

  • 09-11-2019 11:52 AM In reply to

    Re: Repeating table rows with local fields based on number of rows from list?

    Perfect, glad you found a way that worked for you. :)
    Hilary Stoupa

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