May 2009 - Posts - Mel Balsamo
in

InfoPath Dev

This Blog

Syndication

Mel Balsamo

May 2009 - Posts

  • How to Use the Qdabra Modify PI Tool for InfoPath

    Scenario

    When you have moved or renamed an InfoPath form template (XSN), the associated XML files become orphaned from their associated template. You will get an error message when you open an XML file because the associated template cannot be located.

    Value Proposition

    The Qdabra Modify PI Tool for InfoPath (QdModifyPI) modifies the InfoPath processing instruction ("HREF") attribute of an XML file to point to the new template's location.

    Requirements

    • Microsoft .NET Framework 2.0 or higher
      Note: If the tool detects that your machine does not have the latest Microsoft .NET Framework, the tool will install it for you.

    Installation Instructions

    1.       Extract the contents of the package installer in a local directory on your machine.

    2.       Run the setup.exe file and as an Administrator - this will ensure that you will have the necessary permissions to use the tool.

    3.       Follow the on-screen instructions in the installation wizard to install the tool.

    Usage

    A. Single XML File

    You may modify the processing instructions, i.e. "relink" XMLs one-by-one. This is useful if you do not intend to relink all of your XMLs. When you install the tool, it adds a right-click menu option.

    1.       In Windows Explorer, right-click on an XML file and select Modify InfoPath PI from the menu.

     

    2.       The Modify InfoPath PI tool will launch, showing the current PI of the selected XML file.

    a.        Enter a new PI - that is, the location of the new form template (XSN) which you wish to associate your XML file with.

    b.       (Optional) Check the box to open the XML file in InfoPath after modifying its PI.

    c.        Click OK when done.

     

    If you have checked the box shown in the image above, the modified XML will open in InfoPath. Otherwise, you can manually open the file at any time.

    B. Multiple XML Files

    This method assumes that you have multiple XML files stored in a directory. Note that the directory should not contain file of types other than XML. Also note that all these files should have the same PI (i.e. they all point to the same location where the associated form template is stored).

    1.       Launch Modify InfoPath PI.exe from the installation folder. (By default, it is installed in C:\Program Files\AutonomySystems\Modify InfoPath PI.)

    2.       In the Target Folder field, enter the local path where you store your XMLs, e.g. C:\InfoPathForms. You can also click on the folder icon and browse to the local folder.

    3.       In the New PI field, enter the full path to the new location of your form template which you wish to associate with your XML files.

     

    4.       Click OK when done.

    5.       To verify that the modification succeeded, open any of the XML files in the selected directory. The file should open with the new InfoPath form template specified. You can also open any XML file in a text editor such as Notepad and verify that the HREF has changed.

     

    Migrating XMLs from One SharePoint to Another

    When InfoPath form files are saved to a SharePoint Form Library, SharePoint creates hard-coded references to the form template in the team site where the forms are being saved.  If the SharePoint Form Library is moved to a new location, the references in the InfoPath form files will continue to point to the old location, even after they've been moved into the new Form Library. You can update these references in the form files manually or by using a tool.

    The steps below assume that you already have two existing SharePoint libraries, and that you have published your form template (XSN) to both locations.

    Export: Copy the XMLs from Form Library A

    Export the XMLs by copying them from the first form library (we'll call this Form Library A) to your local machine.

    1.       Open Form Library A in Internet Explorer.

    2.       Click on the All Documents drop-down > Explorer View - this will allow you to drag & drop and/or copy all the XMLs at once.

     

    3.       Highlight to select all the existing XMLs and drag them into a folder in your local machine, e.g. D:\SampleForms.

    Use the Tool to Modify the XMLs

    Modify the Processing Instructions of the XMLs using the tool to point them to the form template published in the second form library (we'll call this Form Library B).

    4.       Launch the tool from the installation folder. (By default, it is installed in C:\Program Files\AutonomySystems\Modify InfoPath PI\Modify InfoPath PI.exe.)

    5.       In the Target Folder field, enter the local path where you placed your XMLs, e.g. D:\SampleForms. You can also click on the folder icon and browse to the local folder.

    6.       In the New PI field, enter the full path to the form template that you published in Form Library B.

     

    7.       Click OK.

    The tool will close after successfully modifying PIs of the XMLs in the folder.

    Import: Upload the XMLs to the New Location

    When done modifying the XMLs and they're now pointing to the new location, you can then upload them to Form Library B.

    8.       Open Form Library B in Internet Explorer.

    9.       Click on the down-arrow key next to Upload and then select Upload Multiple Documents.

     

    10.    Drag the updated XMLs from your local folder and drop them into the SharePoint window.

     

    11.    Click OK, and then click Done.

    Your forms should now open with the template in the new SharePoint location.

     

    Purchase the Qdabra Modify PI Tool for InfoPath here.

  • Using InfoPath E-mail Forms to Communicate with External Users

    Greg’s blog post provided brief guidelines on how to create form templates with different versions. One is a restricted version for public-use, i.e. for external users; the other is a version for private use. The private version may contain some additional controls that allow you to do more with your forms, such as submitting them to a SharePoint document library.

    This technique gives us the power to use InfoPath forms to capture offline e-mailed data for centralized SharePoint upload. We can email forms back-and-forth, to and from external users (sometimes offline or disconnected), and at the same time, manage those forms in private locations such as a SharePoint site. We need to make sure that the form data in both the public and the private locations are in-sync.

    This blog post details the steps to setup a sample email form template with two different versions: Public and Private.

    Here’s a diagram of the scenario we’re trying to accomplish: 



    1. You email the form template (XSN) file to an external user (Public version – Ver. 1).

    2. External user (sometimes offline) opens the form template, fills it out and emails back to you.

    3. You receive the form (XML) and open it with the higher version of the form template (Private version – Ver. 2).

    Note that you may receive a warning message that the form template associated with the form has a higher version than the one stored on your computer. Clicking Yes will open the form with your latest version.

    4. You submit the form to your SharePoint document library.

    5. You open the form from SharePoint, edit it and email it back to the user.

    6. User receives the form, accepts the changes, re-edits and re-emails back to you.

    Note that the user may also receive a warning message about the form template version. Clicking Yes will allow user to open the latest form.

    7. You receive the form and re-submit it to SharePoint.

    Sounds interesting? Let’s get started…

    REQUIREMENTS:

    • InfoPath 2007
    • Outlook 2007
    • SharePoint Library

    PUBLIC VERSION

    1. Add the following fields to your main Data Source  



    • Make the EmailAddress field required, so we know where to send the form back.

    2. Add a layout table in your template, and drag the myFields node onto your table as Controls in Layout Table. Expand your controls as necessary to make them fit in your table.

    3. Double-click on your Date field to open its properties.

    a. Under the Data tab, click Format. Select any format for the time such as: 



    b. Click OK.

    c. Back in the Data tab, click on the fx icon beside the Value field, and enter the now() function in the formula box. 

    This will ensure that we’ll have a unique date value every time we fill out a form the first time. We will specify this unique value as the form filename in our SharePoint library later.

    d. Click OK to close all the dialog boxes.

    4. Allow the Comments field to display multi-line in the Comments field properties > Display tab, just so there’s more space for users to fill it out.

    Your form template should look something similar to this:  



    5. Add a Submit data connection.

    a. Go to Tools > Data Connections, click Add.

    b. In the Data Connection Wizard, select Submit data > As an email message.

    c. Specify an email address where you want your external users to send the form to; i.e. <YourEmail>@<YourCompany.com>.

    d. You can enter any value as the email subject or select an existing field in your form template. In this example, we will use our Name field as the Subject. 

    e. Click Next.

    f. Select the option Send the form data as an attachment.

    g. For the attachment name, combine the Name and the Date values. Click on the fx button beside the Attachment Name field, and enter concat formula as seen in the following image, making sure that the underlined fields are from your main data source: 

    h. Click OK (no need to attach the form template in the email), Next, then Finish to exit out of the wizard.

    6. Add and configure a Submit button.

    a. Add a button at the bottom of your table, and double-click to open its properties.

    b. In the Button Properties window’s General tab, select Submit in the Action dropdown, and click Submit Options.

    c. Check the box Allow users to submit this form > Email > Email Submit.

    d. Click the Advanced button to expand the window, and select Close the form in the After submit dropdown: 

    7. Make the form restricted for external users.

    a. Go to Tools > Form Options > Security and Trust.

    b. Uncheck the box for Automatically determine security level, and select Restricted: 

    c. Click OK.

    8. Save the form template as PublicEmailForm.xsn.

    Here’s how our public email form template looks like: 

    PRIVATE VERSION

    Next, we will design our private form template. It will have the same fields, so we can just modify our public form template.

    1. While the public template is opened in Design mode, go to File > Save As and save it as PrivateEmailForm.xsn (to make sure that we are not working on the public version).

    2. Modify the Email Submit data connection.

    a. Go to Tools > Data Connections and modify Email Submit.

    b. Click on the fx button next to the To field and insert the EmailAddress field. This field will contain the external user’s email address (where we wish to send the form back to).

    c. Click Next twice, and then Finish to save your changes.

    3. Configure the SharePoint Submit data connection.

    a. In the Data Connections wizard, click Add to add another data connection.

    b. Select Submit data > Next > To a document library on a SharePoint site > Next.

    For the purposes of this tutorial, we will submit to a SharePoint document library named EmailFormsLibrary. This library should not exist yet. We will create it later when we publish our private form template.

    c. Enter the URL to your EmailFormsLibrary SharePoint library, i.e. http://<SharePointSite>/EmailFormsLibrary/

    d. For the file name, click on the fx button and select Date from your main data source. Again, we are making sure that our form file name is unique each time we submit a form to our SharePoint Library the first time; thus selecting Date which uses the now() function.

    e. Check the box that allows overwrite if file exists. 

    f. Click Next, leave the name as SharePoint Library Submit, and then click Finish.

    g. Exit out of the Data Connections wizard by clicking Close.

    4. Configure the submit buttons.

    Note that we now have two Submit data connections, and we therefore need to use two buttons: one that submits to our SharePoint library, and another to email the form back to the external user. We also need to submit using rules and specify which Submit data connection to use.

    a. Double-click on the existing Submit button to open its properties.

    b. In the Action dropdown, select Rules and Custom Code.

    c. Label the button Submit to SharePoint and click on Rules.

    d. In the Rules dialog, click Add.

    e. Name your rule SharePoint Submit and click on Add Action. The action would be to submit using the SharePoint Library Submit data connection: 

    f. Click OK three times to close the dialog boxes.

    g. In the Controls task pane, select Button to add another button just beside the SharePoint Submit button, and double-click to open its properties.

    h. Label it as Email External User and click Rules.

    i. In the Rules dialog, click Add.

    j. Name your rule Email External User and click on Add Action. The action would be to submit using the Email Submit data connection: 

    k. Click OK three times to close the dialog boxes.

    5. Since we’ve already configured our submit function to use rules instead of the built-in submit feature, we can now disable that. In Tools > Submit Options, uncheck the box that allows users to submit the form, and click OK.

    6. Set the security mode.

    Since this form template is a private version, meaning it is used internally by users in your network/domain, we can allow the form to access content from the domain in which it is located.

    a. Go to Tools > Form Options > Security and Trust and select Domain (or Full Trust). 

    b. Click OK.

    Here’s how our private email form template looks like: 

    7. Save your PrivateEmailForm.xsn form template and then close it.


    MANIPULATING FORM VERSIONS

    Here’s where it can get a bit complicated. We want to manipulate InfoPath to think that our Public and Private forms are one-and-the-same, when in fact, they are two different forms. To make this happen, first, we need to give these two form templates the same ID. This is considered as a “Class A” trick.

    As mentioned in Greg’s blog post:

    The ID is used to determine which template a form will be opened with. But this ID is dynamic. As the Name changes, so does the ID. And every time you do a Save As, the Name and ID are changed.

    A. Let’s start with our public form template:

    1. Open PublicEmailForm is InfoPath Design mode.

    2. Go to File > Properties. Here you will find fields for the Name, ID, and Description. 

    3. To make things simpler and easier to understand, let’s remove the date and time stamp in the template’s URN: 

    4. Click OK then File > Save.

    5. Since this template is what we will email our external users with, we need to save it with a different name.

    a. Go to File > Save As and name it EmailForm.xsn.

    b. In File > Properties, notice that the Name and ID changed. 

    c. Once again, remove the date and timestamps in the URN to avoid confusion. 

    d. Click OK.

    e. Go to Tools > Form Options > Versioning. Notice that the Version number is something like 1.0.0.x, where x is a number that automatically increments as we make changes to our template. We can leave it this way for our public email template.

    f. Click OK, then File > Save.

    6. We’ve already saved the public version as EmailForm; close it, and then send it to an external user by attaching the form template in the Outlook message.


    B. Next, our private form template:

    1. Open PrivateEmailForm.xsn in InfoPath Design mode.

    2. We need to make sure that our private template will have a higher version number than the public one.

    a. Go to Tools > Form Options > Versioning.

    b. Change the Version Number from 1.0.0.x to 1.0.1.x. This way, when we open the forms (XML) in our local machine, they will open with the higher template version, which is the private one. Click OK.

    3. Go to File > Properties: 

    4. Remove the date and time stamp in the template’s URN: 

    5. Click OK then File > Save.

    6. This time, we will overwrite our previous EmailForm.xsn with this private form template.

    a. Go to File > Save As > EmailForm > Overwrite.

    b. In File > Properties, the Name and the ID once again becomes: 

    c. Remove the date and time stamps, click OK then Save.

    Notice that this template (private version) has the same ID as the one that we sent to our external user (public version). Don’t be confused, this template has a higher version number than the one already sent. As we know, forms will open with the higher version template.


    C. Publish the private version to a SharePoint library

    1. In EmailForm.xsn’s (previously PrivateEmailForm) File menu, click Publish.

    2. Select to publish to a SharePoint server with or without InfoPath Forms Services, and click Next.

    3. Enter the URL to your SharePoint site and click Next.

    4. Select to create a Document Library > Next.

    5. Select Create a new document library > Next.

    6. Enter a name for your document library (remember that we wish to submit our forms to a library called EmailFormsLibrary). Click Next.

    7. Promote some or all of the fields in your form as columns: 

    8. Click Next, then Publish, then Close.

    9. Close InfoPath.


    SEE IT IN ACTION

    1. Have an external user fill out and submit the public template you initially emailed.

    2. You will receive the form (XML) in your email. 

    3. In Outlook, click Open Form. It will open with the private version of the template. 

    4. Make some changes in the form, such as editing the Comments, and click the SharePoint Submit button. 

    5. Close the form in Outlook. If you get a warning asking you if you wish to save the form, select No.

    6. Verify that the form is submitted to your SharePoint document library. 

    7. Open the form from SharePoint, make some changes, and email it back to the external user by clicking the Email External User button. 

    8. The external user will receive the modified XML and may receive a warning that the form template associated with the form contains a higher version. Clicking No will allow the user to open the form in Outlook using the public version.

    9. The external user then modifies the form and emails it back to you by clicking the Submit button. Once again, if you open the received XML in Outlook, it will open with the private version:

    10. Re-submit the form to your SharePoint library to make sure you are keeping the latest XML version. It will overwrite the existing XML in your SharePoint library: 

    At this point, we should have three form templates in our machine: PublicEmailForm, PrivateEmailForm, and EmailForm. We are only concerned about EmailForm, as this form template contains the unique Name and ID that we wish to send back-and-forth, to and from our external users, and manage our SharePoint library forms with.

    The PublicEmailForm and the PrivateEmailForm are just temporary placeholders. For instance, if you wish to send a public version to another external user, we can’t send them the latest EmailForm that we have (since it’s supposed to be the private version). To do this, we need to open PublicEmailForm in InfoPath Design mode, and re-save (overwrite) it as EmailForm. After sending to the external user/s, open PrivateEmailForm in Design mode and re-save (overwrite) it as EmailForm, and then re-publish to the same SharePoint document library.

    You’ll realize that we’re just manipulating the same form template in terms of which version will be sent to public, and which version should open in our machine.

    Once you get the hang of this, it will be easy for you to manage your form data and keep them in-sync no matter where you publish your forms.

  • Qdabra’s New Email Builder Tool

    Figure01

    Everyone gathers contact information. Let’s face it: people are the backbone of our business and we need to know how to reach them. We gather this information by collecting the data in forms. Unfortunately, it can be very difficult to reuse this information for other programs, such as an email list. So if you have ever wanted to pull email information out of existing forms in order to reuse that data for sending emails, then Qdabra’s new email builder tool is the answer for you! Our new Email Builder tool is a great way to send out polished, personalized e-mails to one or more recipients based on data residing in a separate InfoPath form.

    This exercise assumes that you have a document type in DAT that maps to a database and stores information that is essential when sending emails, like an email address. The diagram below shows an example of this process:

    Figure18

    Setup

    1. Download the templates from this address and save to your DAT using the New Configuration button.

    2. Install PT_EmailBuilder template and the QdEmailRecord template as separate DocTypes.  For information on creating new DocTypes, refer to DBXL’s Getting Started manual

    3. Additionally you will need to map the QDEmailRecord DocType to a database.

    a. Create a table in your SQL database named EmailRecord with the following columns and data types:

    Figure02


    b. Map each column to node paths specified below: (For additional help on mapping to Databases, review How to Create Database Mappings in DBXL.)

    Figure03

    Using Email Builder

    Once this is complete, you are now ready to test the Email Builder tool. From DAT, launch PT_EmailBuilder by double-clicking on the EmailBuilder form template in your DAT. Your new Email Builder will launch.

    Set the name of your email template and add a company logo using the Insert Picture field:

    Figure04

    Next, enter the details that will be shared with others. This information will appear at the bottom of your completed email.

    Figure05

    Add information for your Subject Line, Greeting and Farewell:

    Figure06  

    Add your email body: (Note that most text formatting will be acceptable in this format.)

    Figure07

    Finally, upload a signature image and title to sign the email.

    Figure08

    Now let’s go and add some recipients!

    Click on the “Pick People” tab:

    Figure09

    You will now choose the DBXL document type that you use to store your contact information. 

    Figure10

    You will also indicate the table that references the information you want to capture.

    Figure11

    Choose the column that contains your recipient name and the contact email address. You can use the Alt. Identifier Columns if you need to specify between same names or other information that may appear to be duplicated (i.e., if you have two Joe Smiths in your data).

    Figure12

    You can also choose to filter the contact list to better customize your list. You can also choose to filter the contact list to better customize your list. For example, you can filter using the contact’s CompanyID and specify a value, or filter through the LastContactDate, etc.

    Figure13

    After clicking the “Find Email Recipients” button, a list of contacts will display to match your filter criteria.  You can now send your emails individually, or you can also choose to cancel an email.

    Figure13

    Save your email template using the “Save Email” button located at the top of the page. You will now have a reference that will contain the exact email that was sent in case you want to reuse it. You will also be able to see whom you sent that email to when you last sent it out, which will be very useful for recurring emails.

    So now that we have whom we want to email, let’s see what our email will look like!

    Click any link marked “Email” to any of the recipients.

    Your Outlook will launch and will display your email, address, etc. Click “Send” and your email will be sent! Please note that you will have to send each email separately. (If you are sending out marketing materials, this will be helpful in having them not sent to the SPAM folder!)

    Figure15

    You can click the “Done” button to put a date and time stamp on the sent email that is logged in the database. It is that easy!

    Figure16

    You will also be able to see a list of the people you have sent emails to. After you click “Done”, each recipient will show up with a date and time stamp that the email was sent.

    Figure17

    Once you started using the Email Builder, you will discover how easy it use to manage and send emails and keep organized at the same time.

    Download the Email Builder tool
    here.

    "Limitation: due to security restrictions in InfoPath’s email adapter our Email Builder tool currently requires manually clicking a button to send each request. As such, it is not a good solution if you have more than 100 customers. For larger lists you can use Report Builder tool in DBXL v2.5 to generate an Excel Spreadsheet and upload that to Mailchimp. We are working on a way to automate the Email Builder tool so that you can do large bulk emailings without having to click through each send."


Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.