Auto-populate repeating table with rows from a custom list - InfoPath Dev Sign in | Join | Help in Web Services InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » Web Services » Auto-populate repeating table with rows from a custom list Use our Google Custom Search for best site search results. Auto-populate repeating table with rows from a custom list Last post 05-03-2021 08:06 AM by Hilary Stoupa. 13 replies. Page 1 of 1 (14 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 10-22-2017 02:23 PM Shina Joined on 10-18-2017 Posts 3 Auto-populate repeating table with rows from a custom list Reply Contact Hi Guys, First, thanks for the information you put on here, it's saved my job countless times. :-) I need help on how to populate a Repeating table with rows from a Custom list. Then allow users to make changes to a column in the repeating table and have the list is updated. Preferably no-code solutions as I have an hybrid SharePoint Implementation here. Here's a background info. I am developing a Performance Management Solution for my firm. On a high level, 1. Every staff fills out a form to set Goals at the beginning of the year 2. At mid-year there is a KPI Review. The staff updates each KPI Target line item in the repeating table with achievements so far. And in another section, the KPIs are revised because targets would have changed since year started. 3. At year-end Review, KPI targets are updated with achievement, supervisor grades staff and appraisals happen. The twist comes at Mid-Year Review because the initial KPI items approved have to be updated with achievements, the KPIs also have to be revised: Add, Update or Delete. So 2 repeating tables and a custom list (InitialKPIList) are needed at least. On the initial view (goal setting) I sent rows from Repeating table A into the Custom list (using a batch xml and list web service). All items in the list from the same form instance will have the same value in a FormNo field. So on Mid-Year View i'm hoping to use the FormNo field to filter the Secondary data source before populating the repeating table B. So repeating table B will be used for Mid year Review, while Repeating Table can be revised and used for the remaining stages of the process. Thanks. Filed under: lists.asmx, infopath2013, Infopath 2010 webservice UpdateListItem 10-25-2017 11:22 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list DefaultDataWithRules 2010.xsn Mark as Not AnswerMark as Answer... Reply Contact So, sounds like you are already using CAML to submit. If you want to copy repeating data without code, I usually use default data for that - add a bunch of nodes by default then use rules or defaults to populate them. I'm attaching a sample form that does this - save it locally, right click and select design to open in design mode & then you can preview. Hilary Stoupa 10-25-2017 01:23 PM In reply to Shina Joined on 10-18-2017 Posts 3 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact Thanks for the help. The default nodes is beautiful, I added about 50 default nodes and set up the rules, it populates my Repeating table perfectly with all items from the list(secondary data source) Now using a formID on the form that matches a formID in the data source, I tried to limit the number of items returned with a 'Query for data' step but it only returns results for the first item. Setting filter conditions on the repeating table would not work here because i expect that the number items in my secondary data source would increase quickly above the default nodes planned for. Any pointers as to how this can be achieved? 10-25-2017 02:00 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact So - drag your secondary data source onto the form where you can see it, both query and data fields - add a button that executes the query. When you query for a specific form ID, do you get back all the rows you expect? Because I'd expect that to work.... I'm not sure if you are saying the data connection doesn't return all the rows, or the rules to set the field values in the main data source is setting them all to the first value. :) Hilary Stoupa 10-27-2017 03:18 AM In reply to Shina Joined on 10-18-2017 Posts 3 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact Thank you Hilary. Like you suggested, I dragged the repeating table to the Form and found that my Query worked fine. The issue was with my rules to set the field values. Fixed it now. :) 10-27-2017 07:39 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact Wonderful - I like to be able to see what I'm working with, so I make a real mess of my forms during design, making sure I can see all the data. Then when everything is working correctly, I clean stuff up. :) Hilary Stoupa 04-30-2021 05:09 AM In reply to Fernando Pikler Joined on 09-16-2019 Posts 8 Re: Auto-populate repeating table with rows from a custom list nextgap_teams.xsn Mark as Not AnswerMark as Answer... Reply Contact Hi Hillary, I'm sorry getting back to an old post, it's just that my issue is closely related to the content here and I didnt't want to create another post just for that. I have a form in which I gather data from sharepoint. the list has 28 entries. I want to do the same as OP did, having all 28 entries from my secondary data source copied to my main data source repeating table. I opened the example you posted here and i'm having trouble with 2 things. First, what does the "@" stand for? on some formulas, I noticed that there is an @ before the variable, i'm having a hard time reproducing this in my form Second, On the second formula on "set" variable (@name[@abbreviation = current()/../field1]) when trying to reproduce this in my form, I get a "/../field1 is not a valid path". For the record, my field is called field1 too and every path in the main data connection have the exactly same path as your example file. The problem is, when I isolate this formula in another field "current()/../field1" it does not point to a problem. It works. It only tells me that the path doesn't exists when I try to add it to the filter inside my secondary data connection in the formula. I'm attaching the form so you might give a look at it. Just FYI, my intention is to bring in the repeating table ALL fields that are on the secondary data source query. The reason why i'm using the sharepoint as source is because this process changes a lot, and I need to bind it to a system where managers can just change the fields whenever they want without having to go inside the .xml file and changing its schema. ty Filed under: repeating table 04-30-2021 07:44 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact Hi - can you tell me where to find the main data source table you are trying to copy to? Right click the field in the field task pane in InfoPath designer and just paste in the XPath. And also, if you could tell me which data source you are trying to copy, and if you already have some rules in place, where to look for those. Most likely the issues you are having are related to the XPaths being different between the two forms. Hilary Stoupa 04-30-2021 02:54 PM In reply to Fernando Pikler Joined on 09-16-2019 Posts 8 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact Path to my secondary connection: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID_x0020_Pergunta (this is the path to my first field which is the primary key of my table and i'll use to lookup every other field) /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Pergunta_x0020__x0028_PTBR_x0029 (this is the path to the second data field which i was trying to use as a test, the x0020 and so on are just ASCII resposes to characters which only exists in my native language) /my:myFields/my:group1/my:group2 -> this is the path for the repeating table in my main connection, containing numeric fields starting with field 2 thru field 6 xdXDocument:GetDOM("STD_OPR_GPS")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:ID_x0020_Pergunta -> this is what that first field that I mentionet above looks like when I insert it into an formula and check the box (show xPath), STD_OPR_GPS is the name of my sharepoint list Thanks for the assistance so far! 04-30-2021 03:05 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list scrn.png Mark as Not AnswerMark as Answer... Reply Contact So - I'm wondering if you maybe attached a different form template? In the one you attached, there is nothing in group2 - I'd expect a repeating group and some fields? Hilary Stoupa 04-30-2021 03:12 PM In reply to Fernando Pikler Joined on 09-16-2019 Posts 8 Re: Auto-populate repeating table with rows from a custom list OP_Readiness_Form.xsn Mark as Not AnswerMark as Answer... Reply Contact ow wow, I actually did attached the wrong one... you know, a whole week programming mess up our brains I guess.. haha sorry for that, attached you can see the right one 04-30-2021 03:37 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list OP_Readiness_Form 20210430 HS.xsn Mark as Not AnswerMark as Answer... Reply Contact Try this copy. Save the file locally, right click and select design. Then you can preview. The XPath for setting the ID (field2) was incorrect - if you check the "edit xpath" box in the formula editor you should be able to see the difference between this one and your original. Then the rule to set field3 was matching the list ID to the "set" field (which was gonna be 1) instead of to field 2 (where we want the ID to be). Hilary Stoupa 05-03-2021 04:52 AM In reply to Fernando Pikler Joined on 09-16-2019 Posts 8 Re: Auto-populate repeating table with rows from a custom list Mark as Not AnswerMark as Answer... Reply Contact Hi Hilary Thank you! worked like a charm But i'm confused now in how I would copy the remaining fields to my repeating table... I tried to mimic the rule applied to the field2 but I had no success. Like i've tried to put the "PP/NPP" field in my field5 Which path I would have to follow to bring the other fields to my repeating table in the main connection? Thanks! 05-03-2021 08:06 AM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,240 Re: Auto-populate repeating table with rows from a custom list OP_Readiness_Form 20210503 HS.xsn Mark as Not AnswerMark as Answer... Reply Contact Is Pergunta PTBR unique per row? I just realized I changed your existing rows without really paying attention - generally, I set a main data source to the list row's ID field (the actual SharePoint Internal List ID) and then use that to filter for the rest of the rows where I'm setting the value. Here's a copy of your form where I've set a few more values (picked at random) - I've added a field to the main data source specifically for the SharePoint List ID and set that first, then for the rest of the fields, you can pick them from the secondary data source and just paste this filter in after: [../d:ID = current()/../my:ListID] Hilary Stoupa Page 1 of 1 (14 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Use our Google Custom Search for best site search results.
So, sounds like you are already using CAML to submit. If you want to copy repeating data without code, I usually use default data for that - add a bunch of nodes by default then use rules or defaults to populate them. I'm attaching a sample form that does this - save it locally, right click and select design to open in design mode & then you can preview.