Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 - InfoPath Dev Sign in | Join | Help in Data Connections 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 » Data Connections » Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Last post 07-03-2012 08:15 AM by LynetteJ68. 14 replies. Page 1 of 1 (15 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 03-09-2012 11:23 AM EpicQQs Joined on 03-08-2012 Posts 8 Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Reply Contact Hello everyone, Goal: I'm trying to store 'templates' of information on SharePoint so that my user doesn't have to fill out the same fields over and over again for a form I am building with InfoPath. The idea is that they can pre-define their fill-outs in SharePoint, and then choose them from a drop down in InfoPath to prepopulate all of the form fields using a data connection. I've created a list on SharePoint (called 'Item Templates') that has the same columns as my Repeating Tables data fields. I've created a drop down menu that pulls this information into Infopath, and specifies which items information to pull using filters on the Title of the item. Inside my repeating table, I include the drop down that references a data connection to the SharePoint list (Item Templates), and displays the Title of these list items. I want to be able to use a template for each item I am adding to the repeating table, which is why the drop down is inside of the repeating table.When I select the template from the drop down, it runs rules and a filter to pull the information specific to that Title. ...It almost works... I have encountered a bug where if I create additional items using the 'Insert new item' option in InfoPath, the feature stops referencing the correct data. But only if I select an item in the drop down that is below the item I previously created.Data Connection Type: Receive from SharePoint ListSharePoint List Name: Item Templates, Fields: Title, field1, field2, field3, field4, field5Item Templates Items:Title: Template A - Metadata: 1,2,3,4,5Title: Template B - Metadata: 1,3,5,4,2Title: Templace C - Metadata: 5,4,3,2,1 Example Drop Down Options (this is the exact order in which they appear, this drop down is INSIDE of the repeating table):Template ATemplate BTemplate CThe rule running on drop down:Name: Set FieldsCondition: None - Rule runs when field changesAction: Set a fields value: InfoPathRepeatingField1 = Title[Title = dropDownValue]Set a fields value: InfoPathRepeatingField2 = Unit_x0020_Value[Title = dropDownValue]Set a fields value: InfoPathRepeatingField3 = Quantity[Title = dropDownValue]Set a fields value: InfoPathRepeatingField4 = Material_x0020_Composition[Title = dropDownValue]Set a fields value: InfoPathRepeatingField5 = Primary_x0020_Use[Title = dropDownValue]Set a fields value: InfoPathRepeatingField6 = Example[Title = dropDownValue]Troubleshooting:- When I select Templace C first, it loads 5,4,3,2,1 into their respective fields in the Repeating Table.- I can then create a new item and select Template B, and it loads the metadata 1,3,5,4,2 into their respective fields in the Repeating Table.- I can then create a new item and select Template A, which loads the metadata 1,2,3,4,5 correctly.It works!So... what's my problem? - The problem is that if I select Template A first, it loads the metadata 1,2,3,4,5 into the respective fields. This is correct, but if I try to insert a new item and pick Template B or Template C, it still loads the metadata 1,2,3,4,5.... as if I was picking Template A. This does NOT happen if I select Template C first, create a new item, select Template B, etc. I think it is getting confused on which data to pull, but I thought this control would be independent from any items created before it, so I am very confused. Please let me know if you see anything wrong logically! Thanks, David Filed under: data connection, repeating table, filtering, infopath 2010, data source sharepoint, SharePoint 2010 03-14-2012 02:24 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact And the dropdown is bound to a field inside the repeating table? Reading through the structure, and seeing that it works with one selection made first but not the others is extremely strange. I'd expect it either work, or not work. If you want me to take a quick look at your rules, you can attach your template to the Options tab. Hilary Stoupa 03-15-2012 07:51 AM In reply to EpicQQs Joined on 03-08-2012 Posts 8 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Hi Hilary, The dropdown is bound to a field in the repeating table, and the drop downs data source is a SharePoint List. I'd attach my template, but it's too large... I have decided not to implement this feature so this isn't urgent by any means. I just thought it was interesting that it worked in one place but not others. Thanks for your response! 06-22-2012 01:17 PM In reply to LynetteJ68 Joined on 06-22-2012 Posts 12 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Did you ever hear/figure out what was causing this? I'm running into this same issue and it's been driving me absolutely insane! It wasn't until I saw your post that I realized it works if I select the last number first and go from there. It's a clunky workaround that at least works but it'd be nice if there was a reason or fix. I actually took the drop down box out of the repeating section and just placed it on the form to get the options, then put a text box in the repeating section that the user will type in the number from the drop down and it still works the same way -- they have to type the last number first and then it works. This seems like a really strange bug. 06-22-2012 01:58 PM In reply to Hilary Stoupa Joined on 06-20-2008 Posts 13,297 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact I never saw the template with the issue - but if you want to attach yours to the options tab, I'd take a look... Hilary Stoupa 06-22-2012 02:06 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact I have a feeling there's a problem with the way both of you have set up the formulas in your rules. My guess is that if you expand the XPath on the formulas, you'll have something like this:xdXDocument:GetDOM("Source")/path/path/Field[../Title = xdXDocument:get-DOM()/path/path/path/DropDown]And the result is that this will locate the value that matches the first dropdown in the form. That would be expected behavior. The formula should really be something like this:xdXDocument:GetDOM("Source")/path/path/Field[../Title = current()]Would you say I'm on the right track? Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 06-25-2012 12:30 PM In reply to LynetteJ68 Joined on 06-22-2012 Posts 12 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Jimmy, you are correct and thank you for replying! That did fix the issue when they're actually entering a Property ID. It's now giving the correct info regardless of the order entered. However, if they've already entered a Property ID, I have a rule set up to update the corresponding collateral fields on open. I copied the rule from the Property ID field over to the Form Load section and it updated the expression to be [...and ../@PID = current()/my:group5/my:grpRepeatPrimaryCollateral/my:intPropID] But when I have a form already filled in and reopen it, all of the collateral fields are resetting to the information that corresponds to the first item from the drop down box. The Property ID field is now just a text field, not a drop down (I have a drop down box outside of the repeating section that lists the Property IDs simply for the user's reference). It's holding the correct Property ID in the text field so I'm really baffled as to why the rest of the info is changing unless the expression above is not actually correct. If I retype the Property ID field in the text field, then the rest of the info changes correctly. 06-25-2012 12:47 PM In reply to LynetteJ68 Joined on 06-22-2012 Posts 12 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact One additional note: if I disable the rule to update the collateral fields on open, then the information is correct when I reopen the form. However if any changes have been made in our systems to the fields we're pulling into the form, the user will have to change the Property ID and retype it in order to get the updates. By the way, my rule on open is if the Property ID field is not blank, then update the other fields -- again, using the same "Set a field's value" actions as I am using in the Property ID "on change" rule. 06-28-2012 12:17 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact If you try to modify a repeating table's values from outside the repeating table, you're going to run into issues like this. The rules have to be on fields inside the table. To accomplish this, you can add a non-displayed field in the repeating group called my:Reprocess, and give that rules to update its own row as necessary. Then on form open, have a rule that sets my:Reprocess to 1 and then to 0. That should trigger the rules on my:Reprocess and allow you to get the behavior you're looking to achieve. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 06-28-2012 12:32 PM In reply to EpicQQs Joined on 03-08-2012 Posts 8 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Jimmy, thats a clever workaround. Thank you so much! 07-02-2012 09:00 AM In reply to LynetteJ68 Joined on 06-22-2012 Posts 12 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Thanks for the suggestion, Jimmy. Unfortunately, it's still not working. I created the ReProcess field inside my repeating section. I have a rule on open to change ReProcess to 0 and then to 1. I copied the rules that are on change of Property ID over to the ReProcess field. However, the rule is identical on the Property ID field and the ReProcess field: @App__[@Note_Number = intLoanNumber and @PID = current()] where Current was originally referring to the Property ID field. I did try to run it like this but it did not update any of the fields. I assume that if the rule as shown is placed on the ReProcess field, then it's actually saying @PID = the current Reprocess value, correct? So I tried to change the rule to say @PID = current()/my:myFields/my:group5/my:grpRepeatPrimaryCollateral/my:intPropID however it's not liking my syntax and tells me it's not a valid location. I also tried @PID = current()/group5/grpRepeatPrimaryCollateral/intPropID but again, it's telling me it's not a valid location. I'm not very familiar with XPath so I'm not sure how this should actually be entered.I then tried something else. On open, I had a rule to set the value of ReProcess equal to PropertyID, then change Property ID to 0 and then set the Property ID value back to the ReProcess value. This should then automatically trigger the regular on-change rules on the Property ID field. However, when it copies the value from Property ID to ReProcess, it only puts the Property ID value from the first record into every ReProcess field. I've tried a rule saying set ReProcess = current()/group5/grpRepeatPrimaryCollateral/intPropID and also just ReProcess = intPropID and they both give the same result.I really appreciate your help with this. I've created a lot of forms, many with repeating sections and many pulling data from SQL sources, however, I've never had to pull data into repeating sections and then have it update so this is all new to me. 07-02-2012 09:14 AM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Hello again, I think you just need to have the ReProcess field's rule use a formula like this:@App__[@Note_Number = intLoanNumber and @PID = current()/../intPropId] Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 07-02-2012 09:39 AM In reply to LynetteJ68 Joined on 06-22-2012 Posts 12 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact I put the following into the filter as an expression ../@PID = current()/../intPropID but it's still telling that it's not a valid location. I also just tried typing it into the XPath as ,,, and ../@PID = current()/../intPropID] but it gave the same message. "../intPropID" does not point to a valid location path of a field or group. I feel like we're so close! 07-02-2012 09:59 PM In reply to Jimmy Joined on 07-03-2008 Posts 2,595 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact You probably need a my: before intPropID, or something along those lines. Jimmy Rishe / Software Developer / Microsoft MVPQdabra Software 07-03-2012 08:15 AM In reply to LynetteJ68 Joined on 06-22-2012 Posts 12 Re: Buggy Repeating Table, Attempting to Pull Fields from SharePoint 2010 Mark as Not AnswerMark as Answer... Reply Contact Jimmy, thank you, thank you, thank you!!! My form is working properly now. I really appreciate your help with this. Page 1 of 1 (15 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.
Hello everyone,
Goal: I'm trying to store 'templates' of information on SharePoint so that my user doesn't have to fill out the same fields over and over again for a form I am building with InfoPath. The idea is that they can pre-define their fill-outs in SharePoint, and then choose them from a drop down in InfoPath to prepopulate all of the form fields using a data connection.
I've created a list on SharePoint (called 'Item Templates') that has the same columns as my Repeating Tables data fields. I've created a drop down menu that pulls this information into Infopath, and specifies which items information to pull using filters on the Title of the item. Inside my repeating table, I include the drop down that references a data connection to the SharePoint list (Item Templates), and displays the Title of these list items. I want to be able to use a template for each item I am adding to the repeating table, which is why the drop down is inside of the repeating table.When I select the template from the drop down, it runs rules and a filter to pull the information specific to that Title. ...It almost works... I have encountered a bug where if I create additional items using the 'Insert new item' option in InfoPath, the feature stops referencing the correct data. But only if I select an item in the drop down that is below the item I previously created.Data Connection Type: Receive from SharePoint ListSharePoint List Name: Item Templates, Fields: Title, field1, field2, field3, field4, field5Item Templates Items:Title: Template A - Metadata: 1,2,3,4,5Title: Template B - Metadata: 1,3,5,4,2Title: Templace C - Metadata: 5,4,3,2,1
Example Drop Down Options (this is the exact order in which they appear, this drop down is INSIDE of the repeating table):Template ATemplate BTemplate CThe rule running on drop down:Name: Set FieldsCondition: None - Rule runs when field changesAction: Set a fields value: InfoPathRepeatingField1 = Title[Title = dropDownValue]Set a fields value: InfoPathRepeatingField2 = Unit_x0020_Value[Title = dropDownValue]Set a fields value: InfoPathRepeatingField3 = Quantity[Title = dropDownValue]Set a fields value: InfoPathRepeatingField4 = Material_x0020_Composition[Title = dropDownValue]Set a fields value: InfoPathRepeatingField5 = Primary_x0020_Use[Title = dropDownValue]Set a fields value: InfoPathRepeatingField6 = Example[Title = dropDownValue]Troubleshooting:- When I select Templace C first, it loads 5,4,3,2,1 into their respective fields in the Repeating Table.- I can then create a new item and select Template B, and it loads the metadata 1,3,5,4,2 into their respective fields in the Repeating Table.- I can then create a new item and select Template A, which loads the metadata 1,2,3,4,5 correctly.It works!So... what's my problem?
- The problem is that if I select Template A first, it loads the metadata 1,2,3,4,5 into the respective fields. This is correct, but if I try to insert a new item and pick Template B or Template C, it still loads the metadata 1,2,3,4,5.... as if I was picking Template A. This does NOT happen if I select Template C first, create a new item, select Template B, etc. I think it is getting confused on which data to pull, but I thought this control would be independent from any items created before it, so I am very confused.
Please let me know if you see anything wrong logically!
Thanks,
David
And the dropdown is bound to a field inside the repeating table? Reading through the structure, and seeing that it works with one selection made first but not the others is extremely strange. I'd expect it either work, or not work.
If you want me to take a quick look at your rules, you can attach your template to the Options tab.
Hi Hilary,
The dropdown is bound to a field in the repeating table, and the drop downs data source is a SharePoint List. I'd attach my template, but it's too large... I have decided not to implement this feature so this isn't urgent by any means. I just thought it was interesting that it worked in one place but not others.
Thanks for your response!
I never saw the template with the issue - but if you want to attach yours to the options tab, I'd take a look...
I have a feeling there's a problem with the way both of you have set up the formulas in your rules. My guess is that if you expand the XPath on the formulas, you'll have something like this:
xdXDocument:GetDOM("Source")/path/path/Field[../Title = xdXDocument:get-DOM()/path/path/path/DropDown]
And the result is that this will locate the value that matches the first dropdown in the form. That would be expected behavior. The formula should really be something like this:
xdXDocument:GetDOM("Source")/path/path/Field[../Title = current()]
Would you say I'm on the right track?
Jimmy, you are correct and thank you for replying! That did fix the issue when they're actually entering a Property ID. It's now giving the correct info regardless of the order entered.
However, if they've already entered a Property ID, I have a rule set up to update the corresponding collateral fields on open. I copied the rule from the Property ID field over to the Form Load section and it updated the expression to be [...and ../@PID = current()/my:group5/my:grpRepeatPrimaryCollateral/my:intPropID] But when I have a form already filled in and reopen it, all of the collateral fields are resetting to the information that corresponds to the first item from the drop down box. The Property ID field is now just a text field, not a drop down (I have a drop down box outside of the repeating section that lists the Property IDs simply for the user's reference). It's holding the correct Property ID in the text field so I'm really baffled as to why the rest of the info is changing unless the expression above is not actually correct. If I retype the Property ID field in the text field, then the rest of the info changes correctly.
If you try to modify a repeating table's values from outside the repeating table, you're going to run into issues like this. The rules have to be on fields inside the table. To accomplish this, you can add a non-displayed field in the repeating group called my:Reprocess, and give that rules to update its own row as necessary. Then on form open, have a rule that sets my:Reprocess to 1 and then to 0. That should trigger the rules on my:Reprocess and allow you to get the behavior you're looking to achieve.
Thanks for the suggestion, Jimmy. Unfortunately, it's still not working. I created the ReProcess field inside my repeating section. I have a rule on open to change ReProcess to 0 and then to 1. I copied the rules that are on change of Property ID over to the ReProcess field. However, the rule is identical on the Property ID field and the ReProcess field: @App__[@Note_Number = intLoanNumber and @PID = current()] where Current was originally referring to the Property ID field. I did try to run it like this but it did not update any of the fields. I assume that if the rule as shown is placed on the ReProcess field, then it's actually saying @PID = the current Reprocess value, correct? So I tried to change the rule to say @PID = current()/my:myFields/my:group5/my:grpRepeatPrimaryCollateral/my:intPropID however it's not liking my syntax and tells me it's not a valid location. I also tried @PID = current()/group5/grpRepeatPrimaryCollateral/intPropID but again, it's telling me it's not a valid location. I'm not very familiar with XPath so I'm not sure how this should actually be entered.
I then tried something else. On open, I had a rule to set the value of ReProcess equal to PropertyID, then change Property ID to 0 and then set the Property ID value back to the ReProcess value. This should then automatically trigger the regular on-change rules on the Property ID field. However, when it copies the value from Property ID to ReProcess, it only puts the Property ID value from the first record into every ReProcess field. I've tried a rule saying set ReProcess = current()/group5/grpRepeatPrimaryCollateral/intPropID and also just ReProcess = intPropID and they both give the same result.
I really appreciate your help with this. I've created a lot of forms, many with repeating sections and many pulling data from SQL sources, however, I've never had to pull data into repeating sections and then have it update so this is all new to me.
Hello again,
I think you just need to have the ReProcess field's rule use a formula like this:
@App__[@Note_Number = intLoanNumber and @PID = current()/../intPropId]
Jimmy, thank you, thank you, thank you!!! My form is working properly now. I really appreciate your help with this.