Recieving data from Forms Library into an Infopath Form - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Recieving data from Forms Library into an Infopath Form

Last post 11-23-2008 10:53 PM by Shiva. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-17-2008 02:19 PM

    Recieving data from Forms Library into an Infopath Form

    Hi,

    I am facing a problem while recieving data from an Infopath form and setting the same data into another form. I am using browser enabled forms ant there are more than 400 fields in each form.

    I have 2 form libraries. One is the main form where user enter all the data , the other which is supposed to fill by some agents outside the organization. Agents can fill n number of forms depending upon the main form in a seperate forms libary. While saving the form by agent they need to enter some unique ID available on the main form. The main purpose of creating a seperate lib is because we do not want to expose data of one agent to other agents.

    Now at last I want data from all the forms filled by agents in the second library to display in a repeating table.

    I tried many alternatives but not getting the right approach.

    1) Created a Secondary datasource to recieve data form forms Library. It gives me the data directly but cannot filter it.
    2) Used GetListItems Web service. Got the data but only the first list entry is recieved.

    Is there any other approach by which I can achieve this or a way to recieve forms lib enteries in a repeating table. Is there any other way so that I can get a form data with more than 200 fields at once.

     

     

     

     

    Thanks
    Sourav
  • 11-17-2008 09:44 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Recieving data from Forms Library into an Infopath Form

    Hello,

    As per your requirement you not required to submit the form to another library. One SharePoint library enough for to execute your process and If you want to give separate permissions to other group and for agents group is different then you can have one more library for this.

    To get the Unique ID form use GetListItems method and filter by ‘Unique ID' and it should be promoted filed in your form. For this you can go through the link below once,

    http://www.infopathdev.com/blogs/agni/archive/2006/05/15/Query-for-Items-in-SharePoint-Form-Library-Using-GetListItems-Web-Method.aspx

    Following above link steps you will get the list of node for Unique ID. But you want to list of nodes then change the code as below,

    IXMLDOMNode getListItemsResult = thisXDocument.GetDOM("GetListItems").selectSingleNode("/dfs:myFields/dfs:dataFields/ns5:GetListItemsResponse/ns5:GetListItemsResult");

    Changed to

    IXMLDOMNodeList getListItemsResult = thisXDocument.GetDOM("GetListItems").selectNodes("/dfs:myFields/dfs:dataFields/ns5:GetListItemsResponse/ns5:GetListItemsResult");

  • 11-18-2008 07:52 AM In reply to

    Re: Recieving data from Forms Library into an Infopath Form(Copy XML data/Schema to another form)

    Thanks Shiva for the reply. I am using Infopath 2007, does this code works for Infoptah 2007 too.

    I have a bit tricky situation. Let me explain you the problem statement once more in detail.

    I have 2 forms Libraries A & B. In LIBRARY-A I have main forms with 6 views. For each form in LIB-A I have n # forms with more than 200 fields in LIBRARY-B. In a print view of LIB-A I want to get all the forms from LIB-B and show at once.

    The Schema in LIB-B forms and LIB-A forms(print view) is exactly same with groups/field name etc. Is this possible to copy the whole xml data/schema to another form. Otherwise I had to take out each and every data element form the form in LIB-B to LIB-A to show on the view. Even this approach is going to make my form very slow.

    Has anyone tried this kind of thing before. Any suggestion is appreciated.

    Thanks
    Sourav
  • 11-23-2008 10:53 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Recieving data from Forms Library into an Infopath Form(Copy XML data/Schema to another form)

    Hello,

    We can copy Library A form details to Library B form in onLoad. What is the filter value for these two fields? While opening the Library B form, where we need to get the details from Library A (what is the file name of the form)?

    If you want unique ID is file name then we will load Library A form details to Library B form using GetList web service connection.

    After getting the Library A form in onLoad, we can replace the nodes with old node If both schema structure is same. Otherwise we have to populate the field's data by field.

    Replace the node code:

    IXMLDOMNode OldChild = libraryAFormDOM.selectSingleNode("<XPath of the node>");

    IXMLDOMNode NewChild = thisXDocument.selectSingleNode("<XPath of the node need to be replace with this node");

    OldChild.parentNode.replaceChild(NewChild,OldChild);

    Populate the node data:

    string  OldChildValue = libraryAFormDOM.selectSingleNode("<XPath of the node>").text;

    thisXDocument.selectSingleNode("<XPath of the node need to be replace with this node").text = OldChildValue;

    Note: The above code in C#.

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