Copy every row in a repeating table to a textbox - InfoPath Dev
in

InfoPath Dev

Copy every row in a repeating table to a textbox

Last post 07-10-2013 03:08 PM by Doreen. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 07-03-2013 02:37 PM

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Copy every row in a repeating table to a textbox

    I'm using IP 2007.

    I have a repeating table that is 3 columns wide.  I want columns 2 and 3 only, from ALL rows (no matter how many there are),  to copy to a a textbox field on button click.

    Basically I want to copy all row contents using concat() function to a textbox.  Is this possible?

    something like this:

    concat( row1:column2, ",  ", row1:column3, ",  ", row2:column2, ",  ", row2:column3, ",  ",  row3:column2, " , ", row3: column3....and so on)

    p.s. the reason for wanting to copy all rows to one textbox is to display row values in a sharepoint list column.

  • 07-07-2013 11:40 AM In reply to

    Re: Copy every row in a repeating table to a textbox

    Yes, you can do this using the double-eval trick. Something like this:

    substring(eval(eval(RepeatingGroup, "concat(', ', my:column2, ', ', my:column3)"), ".."), 3)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-09-2013 11:10 AM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy every row in a repeating table to a textbox

    Thank you.  I have tried this but I am not getting the values from the columns to display in textbox - I am only getting the colon I used (in place of one of the commas).  I'm attaching screenshots in Word of Rule I used and data source in case you have time to see where I might be going haywire.  I'll keep trying different things (single quotes, double quotes, etc.  Most of the time the error I get is end of string or eval has incorrect number of statements.)

    BTW the rule I used in my example is the only one that would pass Verify Formula check.

    Thank you.

    p.s. what does  ".." do in your example? 

  • 07-09-2013 12:34 PM In reply to

    Re: Copy every row in a repeating table to a textbox

    Ok, the trouble is that you are including more in the paths than you need to. Since the context node in this case is F-Note, all you need is paths relative to that: 

    substring(eval(eval(F-Note, 'concat(", ", my:DateNote_F, ": ", my:NoteDetail_F)'), ".."), 3)

    The explanation for why this formula contains ".." is actually a little complex, but the double-eval formula will always contain that part, so it may be easier to just remember it as-is. :)

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-09-2013 02:00 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy every row in a repeating table to a textbox

    Thank you.  I got it to work thanks to your help!

    The issue I was having with your formulat is that the extended paths were added automatically after I selected the node.  I would then receive error that not all paths lead to valid node (blah di dah).  I realized that I could simply erase the excess path after it filled in and the formula finally worked.

  • 07-10-2013 12:01 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy every row in a repeating table to a textbox

    As a follow up, there is one issue with copying the two columns from repeating table row to a text box.  The first row or set of notes is a date picker control (col1) and textfield control (col2).  The very first row cuts off the 2 in the year date part but the subsequent rows include the 4 digit year. See my image attached from SharePoint list view.


  • 07-10-2013 12:39 PM In reply to

    Re: Copy every row in a repeating table to a textbox

    It looks like you've deleted the space that was after the comma in the original formula. In that case, you would need to change the 3 at the end of the formula to a 2.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 07-10-2013 03:08 PM In reply to

    • Doreen
    • Top 50 Contributor
      Female
    • Joined on 08-11-2010
    • Federal Way, WA
    • Posts 291

    Re: Copy every row in a repeating table to a textbox

    Oh my word, you are exactly correct.  Thank you.  That fixed it!

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