Repeating Table from Secondary Data Source with additional fields from Main Data Source - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Repeating Table from Secondary Data Source with additional fields from Main Data Source

Last post 05-30-2018 11:56 AM by Daniel_5584. 20 replies.
Page 1 of 2 (21 items) 1 2 Next >
Sort Posts: Previous Next
  • 01-23-2015 06:46 AM

    • de_99
    • Not Ranked
    • Joined on 01-23-2015
    • Posts 1

    Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Hi, I've found a lot of things close to this topic, but nothing that gets to my issue.

    I am building a data entry form for project managers. They choose the project name from a drop-down, then it sets the value of the 'Project' field in my secondary source repeating table and queries the data source to populate with that project's metrics. The project name list and the project metrics list are stored in SharePoint lists; they projects have different numbers of metrics, from 5-25.

    I want to add a field, next to the name of the metric, where the project manager can enter data and another field where they can enter notes. I.e., a table with | METRIC NAME | METRIC VALUE | METRIC NOTES | where "METRIC NAME" populates automatically based on the project (whether that's 6 metrics/rows or 15 metrics/rows), and then data can be entered into the "METRIC VALUE" and "METRIC NOTES" fields.

    Several posts suggest 'copying' the "METRIC NAME" field (secondary source) to a repeating table with the data entry fields, but I can't figure out how. I've tried setting up rules to enter the metric name in the (main source) repeating table when the value in the secondary source table changes, but that doesn't work.

    ------

    The outcome I am looking for is that the project manager selects their project, the form populates with correct number of fields and the name of project metrics, and the project manager enters the metric data. Please help!


  • 01-23-2015 03:50 PM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    In InfoPath, there is no built in rule based way to copy repeating data from a secondary data source to the main data source.

    Your options are:

    1. Write code
    2. Use qRules (which is a code DLL you can use with rules)
    3. Use default data and XPath to set default values (this is the only code free option, but involves having a good sense of the max possible number of rows you'll need in the main data source)

    For option 3, under the Data tab in the ribbon, you can add additional instances of your main data source repeating row to be included by default. Then you can use a formula for the default value for Metric Name that takes into account the selected project and the position of the row (this sounds ALOT harder than it is, I'm included a sample for this - save the linked form locally, right click and select design to open in design mode & from there you can preview it and check it out)

    Hilary Stoupa

  • 03-10-2015 12:17 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Hi Hillary, I have used option 3 & followed your sample to copy the data from sec source to main source. This worked, however the formatting in the main data source is not maintained - I would like it to appear as it is in the sec source. Pls see attachment to see the issue.
  • 03-10-2015 10:54 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Did you add multiple instances of the main data source repeating node via the defaults in the data tab? Then use default values to set them?

    Hilary Stoupa

  • 03-10-2015 12:11 PM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Yes I have, & it's still giving me the same result. Is there a tutorial on this somewhere I can reference against?
  • 03-10-2015 12:18 PM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    If you want to attach your form to a reply, I can take a quick look.

    Hilary Stoupa

  • 03-11-2015 02:37 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    My form picks data from a sharepoint list, & you may be unable to preview this data due to restricted access to the SHP. How else can I replicate a secondary data source without connecting to a website? I wanted to create an xml doc for the data connection but I don't have xml notepad. Even sharing the form is proving a challenge - but I'm trying to build my infopath skills. Maybe you can share a quick tutorial on how one executes option 3 so I can see if I missed a step. Or could it be because your form picks data from an xml file while mine is from a SHP list?
  • 03-12-2015 01:53 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Hi Hilary, I've attached the form for your review. Please open it in design view to access. It seems the issue is with how the data is being copied to the main data source (group 29). Even though I have set 3 of these groups with the same default value, it copies all of it into the first line. Please see the preview attached in the next post. I would really appreciate your help.
  • 03-12-2015 01:57 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    See preview of form attached.
  • 03-12-2015 08:01 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Oh - I see - I hadn't realized your secondary data had repeating fields. If you want the same structure in your main data source, I think you'll need to make field29 (for example) in your main DS repeating, then add instances in the default data and set default values again.

    Hilary Stoupa

  • 03-02-2017 02:42 PM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Hi Hillary, Thanks for the innovative solution, I had a run through the Data source that you have used, I have a slightly different source and looking to see how I can use your solution. Your Sample Data Source: A A-1 A-2 A-3 B B-1 B-2 C C-1 C-2 C-3 C-4 My Sample Data Source: 1.20 GENERAL INFORMATION Port of the last Port State Control inspection (this includes if vessel was detained, or if significant deficiencies were listed) 10 1.23 GENERAL INFORMATION Date the last special survey was completed 10 1.24 GENERAL INFORMATION Date of departure from the last class-credited drydock/repair period 3 Question: Is there a way to Populate each 'Question' tag as a separate row with QNo,Category,QText,PotentialRisk as columns to that row?
  • 03-03-2017 08:06 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

     The general approach should be the same, regardless of the names of your fields. Attach your form file under the Options tab if you need a hand. :)

    Hilary Stoupa

  • 05-02-2018 02:55 PM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    Hi Hilary, I am having a similar issue as the OP. I am attempting to pull field data from a repeating table in a secondary data source to populate a repeating table in my main data source. My secondary data source is a SharePoint InfoPath form library. I am not able to use code as my site does not allow it. I am trying to use default data and Xpath to set default values and, thanks to the help I received reading this post, I feel that I am very close to a solution but I am not there.

    The XPath I am using is:

    xdXDocument:GetDOM("Customer Complaint Reports")/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Product[../d:ID = xdXDocument:get-DOM()/my:myFields/my:CMNumber][count(current()/../preceding-sibling::my:ProductInformation) + 1]

    This will successfully pull the first item, but I cannot get the remainder to populate (Even if I set the number to "2", "3", etc.). Can you tell me what I am doing wrong?

    I attempted to attach my forms for reference, but I get the error that the upload webpage may be down or may have moved to a new address.

    Any help would be greatly appreciated.

    Thanks,

    Daniel
  • 05-02-2018 04:16 PM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

    What is the XPath to your repeating group? You can right click on it in the fields pane and select copy XPath to find it. You can also try using Internet Explorer to see if you are able to attach a file under the Options tab & I can give you a hand - sometimes the forum works better w/ IE.
    Hilary Stoupa

  • 05-03-2018 07:29 AM In reply to

    Re: Repeating Table from Secondary Data Source with additional fields from Main Data Source

     Hi Hillary,

    Thank you for your quick response to my post. Changing to IE did the trick. I seem to only be able to attach one file to a post. The one attached to this post is my main data source. I will attach the secondary data source in my next post.

    To answer your question regarding the XPath, this is the XPath of the promoted group: /dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Product_x0020_Information

    However, that is my issue. These are two separate forms; each a template for its own form library. When publishing the form I am using as a secondary data source I had tried to promote the repeating table group, but it only promotes it as a count of the group items if I add it as a column, and will not promote it at all if I try to use it as a web part connection  (I am fairly new to SharePoint and InfoPath, so I still don't fully understand much of it yet).

      

Page 1 of 2 (21 items) 1 2 Next >
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.