Moving nodes from one form to another - InfoPath Dev
in

InfoPath Dev

Moving nodes from one form to another

Last post 09-22-2010 11:57 AM by Patrick Halstead. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 09-20-2010 01:24 AM

    Moving nodes from one form to another

    I have a template that is used in about 200 forms that have in them bunch of same tipe of nodes.

     this is what I have (a site collection with 20 sites with 16 libraries with one document form in each library)

    site1                 site 2                            site3

    lib1                   lib1                              lib1

    lib2                   lib2                              lib2 

    lib3                   lib3                              lib3

    etc..                etc..                             etc..

     

    inside of each lib I have that one form

    each form has following nodes inside of repeating table

    monthly update

    update

    update

    update

    monthly update

    update

    update

    monthly update

    ....

    What I need is to make a copy of monthly update (just monthly ones, not the regular ones) form site2 lib1 and from site3 lib1 and paste that copy into site1 lib1

    in other words

    site3-->lib1-->form-->monthly update   |---->------------------------------------->site1-->lib1-->form-->monthly update1

    site2-->lib1-->form-->monthly update   |---->------------------------------------->site1-->lib1-->form-->monthly update2

    any help?

    Regards

  • 09-21-2010 05:07 PM In reply to

    Re: Moving nodes from one form to another

    Hi Colecg and welcome to our forum,

    I'm going to ignore the fact that your solution seems overly fragmented and hard to maintain and just respond to your question ....

    Note: I'm assuming you are not using content types. Content Types could help you simplify the maintenance of your form templates (XSN) since publish once could update all libraries. But, we'll assume you are not using these since your architecture is really bad as it is.

    Fastest solution would be to install the free QRules v2.3 trial and use the command which allows you to submit a form XML to a different SharePoint library/site. Works with rich client forms but not browser. That's the fastest and probably cheapest way to go but it does require purchasing a cheap product later ($200).

    Of course, if you are using rich client, you can just use Save As too but that won't update the href to point to the new template. To manually update the href you can file->save the form XML to your local computer's desktop, open that XML in notepad and change the href in the XML to point to the new site. Save the XML back. Double click it to open in InfoPath rich client and then submit. Only works in rich client. No browser support.

    You could change your form to add a rule that launches a new InfoPath form and give it the location of the target form library. However, this won't copy the values in. Assuming the schemas are the same, you could use File->Merge Forms from the target to pull the source form's XML. That might be an easy solution with no cost.

    You could also add a button to your form that launches the target form template with input parameters. The input parameter is the location of your source XML. When the target XSN opens it can load the source XML into the form and copy the values. Requires qRules and a little extra code, but doable. Unlike the first approach this can be done in the browser but would require admin deploy since the form would have code.

    You could open the target and have it pull data from the source form in. Assuming that your InfoPath form libraries have the fields promoted so they show up as columns in the library, you can just copy those values into your form using rules and a SharePoint URL data connection. Easy to do but the data connection would be hard-coded so you have to specify it. You could add code to do this on demand based on some value in the form but that would be more work.

    Hopefully one of these ideas seems interesting to you.

    Happy trails!

     

     

    Patrick Halstead
    Project Manager at Qdabra
  • 09-22-2010 12:09 AM In reply to

    Re: Moving nodes from one form to another

    Dear Patrick,

    Thank you for your time.

    First, I am using content types. Sorry for not noting this in the first post this is showing I am new to InfoPath. Also, I am using rich client, it is not browser enabled.

    I have one content type for all sites, except main site where monthlies come to, which is little different.

    Idea was to use one content type and then use libs alerts to alert chief and deputy of that dept on changes on the lib or any of the forms.

    What I have as of now is I have all docs from all sites from all lib1 be secondary  sources into my main site-->lib1-->form1.

    There I loop through my secondary sources, and filter them and pick and save only monthly ones. It works fine.

    I was just looking for some other possibility.

    Thank you very much for your time

    Best regards,

    Amira

  • 09-22-2010 12:37 AM In reply to

    Re: Moving nodes from one form to another

    Hi Amira,

    Content Types are a best practice. Good job on that.

    I'm confused by your explanation: "I have all docs from all sites from all lib1 be secondary  sources into my main site-->lib1-->form1"

    Isn't this rather non-scalable? You must have lots of data connections for your form template and whenever a site->library is added you have to update the form template, right? This doesn't seem like the correct solution to me.

    You should just use a secondary XML file and put the libraries and sites in that and use one XML receive data connection for all of your "config data". This file lives on the SharePoint site so it can be updated easily. No need to update your XSN.

    Good luck!

    Patrick Halstead
    Project Manager at Qdabra
  • 09-22-2010 12:57 AM In reply to

    Re: Moving nodes from one form to another

    Thank you again for quick response.

    you are right every time new lib is added I have to update my xsn. but the structure is fixed now. no more new libs.

    I just did not think of that, again I am new to InfoPath

    So, you are suggesting to create another XML file to serve like app.config file?

    And have paths to other sites and their libs in that xml file rather than have those as secondary sources via xsn?

    Then have one receive connection to that xml file and loop through all nodes for paths to forms I want to bring data from?

    What do I do after I grab a path to specific document/form in specific lib on specific site?

    Would I still have to create (temporary) secondary data source object to be able to bring the data? or there is other way which I again am not aware of!!

    Thank you very much for all your precious time.

    Best regards,

    Amira

  • 09-22-2010 11:57 AM In reply to

    Re: Moving nodes from one form to another

    Yeah, that's the idea - just like a web.config or an app.config file.

    You have a group node with a repeating group underneath it with fields underneath that for your site->lib paths and other metadata associated with them.

    If the schema for the forms in the site->libs are all the same (and they are since you're using a content type), you can either use a rule loop through the data and bring it in (see Jo-Anne's latest download for an example of how to use a rule loop to copy multiple ShP list rows into a form), or you can have it be dynamic. When they select the one they want you can just load that one or use a button to load it.

    We use Web Services for loading XMLs. In your case, you may have to write a little code in your form to load them. Sorry I didn't think of this issue before. You could promote all of the properties you need and just use the SharePoint list Web Service to load the values but that's not the same as loading the XML.

    Maybe you should just stick with what you have. If it's working, no need to change it.

    Cheers!

     

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.