Free Sample: Copying Repeating Data - Patrick Halstead
in

InfoPath Dev

Patrick Halstead

Free Sample: Copying Repeating Data

This sample form shows two ways to copy repeating data from a secondary data source into your form's Main data source.

Secondary data sources can be defined in InfoPath Designer from the Data Connections dialog. You can have pull data from a SharePoint list, another InfoPath form (XML file) on your network, tables in a SQL Database or a Web Service.

In just a few minutes, you can learn how to copy data from this sample form. Just download the attachment, right click and open it in the InfoPath Designer.
 
Requirements:
  • InfoPath 2007 or InfoPath 2010

Comments

 

DC-jeff said:

Patrick -

Does the form require the use of "viewdata" as a secondary datasource?  I've tried to incorporate the "count" and "lastitem" into my main datasource but am getting unexpected results.

i.e. replacing

xdXDocument:GetDOM("items")/items/item/a[../id = xdXDocument:GetDOM("viewdata")/viewdata/count]

with

xdXDocument:GetDOM("items")/items/item/a[../id = /my:myFields/my:count]

does not populate the values.  I've hard coded the xpath for testing:

xdXDocument:GetDOM("items")/items/item/a[../id = 1]

and confirmed that it returns the correct row.  Just curious about the "viewdata" secondary datasource as a dependency.

thanks

Jeff

September 7, 2011 12:27 PM
 

Patrick Halstead said:

Hi Jeff,

It doesn't require viewdata. Check the data type on the count. It should be the same as id. Probably something simple. It will work.

September 7, 2011 11:31 PM
 

Keadlard said:

Patrick,

I seem to have gotten this working for 1 record, seems like I have missed something.  

I have a button that starts the process and sets the first value (WebPart) as " ".   Depending on a choice, it sets the value of the Lastitem and current.  And finally if current item is less than Last Item and WebPart = " ", it copies the value to the main data connection.  Unfortunately it stops after 1 record.  What did I miss?

September 9, 2011 3:00 PM
 

Keadlard said:

Got it working now, but have a blank line at the top.  

September 12, 2011 2:41 PM
 

Patrick Halstead said:

Hi Keadlard,

To remove the blank line, go to the data tab in the designer's ribbon. Click on Default Values and find the repeating group that has the blank line. Uncheck it so that it doesn't include a default row.

Hope that does the trick!

September 13, 2011 10:45 PM
 

Twitted by WonderLaura said:

Pingback from  Twitted by WonderLaura

October 25, 2011 10:30 AM
 

Olgierd said:

Hi Patrick,

I am really struggling with this approach. I am exporting data from Excel to XML schema, which is dynamically connected to my form. When I enter 10 lines of data - form loads the content correctly, but when I place 100 lines, it just loads the first line. I checked the XML schema and it contains all 100 lines, so what might be causing the issue?

May 3, 2013 4:39 AM
 

Olgierd said:

Hi Patrick,

I am somehow struggling with this approach. I need to load huge tables from Excel, therefore I have an Excel files that saves the table in XML format in a SharePoint library, this XML is connected to my form and is supposed to dynamically update repeating table once a button is clicked. It works fine if table has 10 lines. If it is bigger than in my main data source repeating table I am only getting the first line. I checked the XML file and all 100 lines have been stored correctly in the secondary data source, so what might be the issue?

May 3, 2013 4:42 AM
 

danilao said:

Patrick, I watched your video "InfoPath Dashboard - Displaying Repeating Data in Libraries -- February 28, 2013 Webinar".

Where I found a STEP by STEP to do that form?

August 22, 2013 12:55 PM
 

Sproctor722 said:

I downloaded the form and repeated the rules in my form, but can't seem to get this to work. It's not returning any rows.

August 29, 2013 12:48 PM

About Patrick Halstead

Hello! I am the founder of Qdabra Software, a small bootstrap software company focused on electronic forms for customers of all stripes. We help organizations design and implement solutions using off-the-shelf technologies such as Office 365, SharePoint and InfoPath. We help you build form solutions in the cloud or on premises. My hobbies include running, hiking, independent film, and Japanese culture.
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.