<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Applying New InfoPath Template Columns to Existing Forms in SharePoint Document Library</title><link>https://www.infopathdev.com:443/forums/thread/120989.aspx</link><pubDate>Mon, 13 May 2019 22:33:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:120989</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/120989.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=120989</wfw:commentRss><description>Thank you so much for sharing your code sample - I am sure others will find it useful.</description></item><item><title>Re: Applying New InfoPath Template Columns to Existing Forms in SharePoint Document Library</title><link>https://www.infopathdev.com:443/forums/thread/120986.aspx</link><pubDate>Mon, 13 May 2019 20:34:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:120986</guid><dc:creator>jraymar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/120986.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=120986</wfw:commentRss><description>Hi Hilary,&lt;br /&gt;&lt;br /&gt;

Thank you for your suggestion and explanation. I&amp;#39;ve tested using your suggestion and so far it has worked well. As a general note, if anyone is looking to do this in Python, I&amp;#39;ve shared my code below. The general structure is to loop through an InfoPath file directory, apply the update, and write the XML to a new file in a secondary location.&lt;br /&gt;
------------------------------------------&lt;br /&gt;
&lt;br /&gt;
import lxml.etree as ET &lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
directory = &amp;#39;W:&amp;#39; #Mapped SharePoint directory to network drive&lt;br /&gt;
newdirectory = &amp;#39;C:\\newXML&amp;#39; #Location to write new InfoPath XML files to&lt;br /&gt;
&lt;br /&gt;
xslpath = &amp;#39;C:\\SPFiles\\upgrade.xsl&amp;#39; #Location of &amp;#39;upgrade.xsl&amp;#39; file&lt;br /&gt;
&lt;br /&gt;
for filename in os.listdir(directory):&lt;br /&gt;
    filepath = directory + &amp;#39;\\&amp;#39; + filename&lt;br /&gt;
    newpath = newdirectory + &amp;#39;\\&amp;#39; + filename&lt;br /&gt;
    &lt;br /&gt;
    dom = ET.parse(filepath)&lt;br /&gt;
    xslt = ET.parse(xslpath)&lt;br /&gt;
&lt;br /&gt;
    transform = ET.XSLT(xslt)&lt;br /&gt;
    newdom = transform(dom)&lt;br /&gt;
    newxml = ET.tostring(newdom, pretty_print=True)&lt;br /&gt;
&lt;br /&gt;
    f = open(newpath, &amp;#39;wb&amp;#39;)&lt;br /&gt;
    f.write(newxml)&lt;br /&gt;
    f.close()&lt;br /&gt;</description></item><item><title>Re: Applying New InfoPath Template Columns to Existing Forms in SharePoint Document Library</title><link>https://www.infopathdev.com:443/forums/thread/120980.aspx</link><pubDate>Mon, 13 May 2019 15:24:54 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:120980</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/120980.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=120980</wfw:commentRss><description>I would add the new fields to the XML without trying to open each one in InfoPath, just directly updating the XML file - and I&amp;#39;d probably do that via applying an XSLT. If you save your form template as source files (from the Publish menu) you&amp;#39;ll find upgrade.xsl in those files. That is what InfoPath is applying to your existing XML when you open them. Test with a small sample, make sure you have made a backup of your test files first - but applying the upgrade.xsl should have the same result as opening / submitting each file.</description></item><item><title>Applying New InfoPath Template Columns to Existing Forms in SharePoint Document Library</title><link>https://www.infopathdev.com:443/forums/thread/120979.aspx</link><pubDate>Mon, 13 May 2019 14:46:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:120979</guid><dc:creator>jraymar</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/120979.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=120979</wfw:commentRss><description>I have a question about updating InfoPath form templates in a SharePoint document library. The library has ~70,000 records (InfoPath forms). I updated the form template to include some additional columns and would like to apply this change to the previous records. Specifically, I would like the InfoPath XML files to contain the (empty) columns.
&lt;br /&gt;
&lt;br /&gt;
From testing, I see that publishing the form template, opening an older form, and either saving or submitting it will propagate the new columns to the XML. However, this is not practical for 70k records. I tried re-linking the forms, using C# CSOM to check-out/check-in all the documents, and using C# to save all the documents - none of these approaches worked. My understanding is that these didn&amp;#39;t work because the form was never &amp;#39;opened&amp;#39; in InfoPath (either in the browser or application), and so even though the form template was linked, it was never applied.
&lt;br /&gt;
&lt;br /&gt;
Is there a way to both link and apply a new InfoPath template to existing forms? The only option I can think is to write a script that opens each file in the InfoPath application and save/submits it to the existing library. However, I am unsure of how to do this or if it is even possible. The other option is to write a script which adds new XML fields to the existing documents, but would that not conflict with the new template? If anyone has any advice, it would be greatly appreciated.</description></item></channel></rss>