InfoPath – Repeating Table Select One Primary Row

Need to ask users to select one row in a repeating table?   Then you’ll want to see the screenshots below.  There are four simple components:

  1. Repeating table has “rowNum” with default value formula to dynamically calculate a row number.   “count(../preceding-sibling::*) + 1” can be entered with XPath mode.
  2. Main non-repeating “selectedRow” field outside of the table.  Will store the user selection.
  3. Make Primary” button in the repeating table.  Action rules here update the “selectedRow” number.
  4. icon” section to show the actively selected row.  Formatting rules here show it only when selected.

 

Now when a user clicks the “Make Primary” the main non-repeating “selectedRow” value will be updated to have the number of the actively selected row.  Formatting rules will hide the button and display a green check mark instead.  This provides user feedback and makes for a more intuitive experience.

Also, this solution could be extended with checkbox icons for a more seamless feel.  Simply change the regular “Make Primary” button to a picture button with an image with an unchecked box.   Then update the section to have an image of a fully checked box.   There are many options to format the active/de-active row display.

xsn16   CLICK HERE to download the XSN file

 

image

image

image

imageimage

image

image

image

11 Comments

  1. Good one Jeff. Liked the idea of dispalying an icon instead of a button, which totally changes the user experience.

    1. Thanks! Background color and icons can go a long way to make the form UI both more usable and aesthetic. I really like using Word SmartArt diagrams to highlight where we are in the process (i.e. stage 2 of 5)

    1. Great question DMS. I think the best way to do this would be just to start numbering at #1, 2, 3… like normal … but then hide row #1 with conditional formatting (hide if row num = 1) so the end user won’t see it.

  2. Perfect and a great simple example to follow , got it up and running in 30 minutes on my project.
    Beats all the others I looked at found with Google using checkboxes and repeating tables. The end solution looks more intuitive for users as the button and section graphic can be customised

  3. Is it possible to repeat a rows in the repeating table based on some range selected by the user? Say for example, I have a dropdown list1 called (starthour) which stores values from (1-24) and another dropdown list called the (endhour) which stores values from (1-24). starthour is set to 1 as and similarly end hour is set to 24 by default.

    When the default is 1 and 24 the repeating table show should all the hours worth data from 1-24. The columns on the table are Hour, MegWatt, Price. if the start hour is 1 and end hour is 24 then the repeating table should show all the hours,megwatt and price from 1-24.

    If incase the user select 5 on the starthour and then 20 on the endhour dropdownlist then the table should populate from hour 5 to 20 hours data.

    if the starthour is greater than end hour then dont show any row/column.

Leave a Comment

Return to Top ▲Return to Top ▲