Mel Balsamo
in

InfoPath Dev

This Blog

Syndication

Mel Balsamo

  • Query Forms from within other Forms

    You may download the files used in this blog post from this link

    Overview

    Sometimes you have a form and you want to show another form's data, without actually copying it into your form.

    In other words, you don't want to include the queried form into your form. You just want to link the forms together and show the related form as a reference.

    How do you add this "satellite" form to your main form without impacting the design of your main form?

    In this blog, we'll show you how to query and display data from a separate satellite form without ruining the integrity of your main form.

    Requirements

    • You are a site collection admin.

    • Your site has the FormsViewer App installed, or your SharePoint admin can install it.

    • You have an InfoPath form or access to InfoPath Designer to create one.

    Sample Scenario = Policies

    Every business process needs a policy. The policy may change throughout the year. For example, an expense report may require receipts for expenses exceeding $100 this year, but this limit may be raised to $150 next year. The business process admin should be able to update the policies by going in to the Policy library and adding/updating forms.

    Usage Scenario

    View Policy

    1.       User opens up your form

    2.       Clicks on Show Policy

    3.       If no matching policy exists, Main form shows "No policy document"

    4.       If policy form exists, Main form queries the policies form

    5.       Main form displays the policy

    Add or Edit Policy

    1.       Business Process Admin adds a new policy with the name for the main form which it will target

    Components

    To implement, you will need the following:

    • Policies Form - required

    • Policies XTP - generic XTP that can be configured

    • Your Main Form - where you insert the XTP

    Technique

    Query the Policy form library using the URL for the Main form (as if it is a unique ID to search for a policy).

    Here’s how the Policy Form looks like – simple and straightforward.

    image1 

    Publish your Policy form into your SharePoint library. Submit your business process policies using that form, specifying the Target Form Name, e.g. Expense Report, Leave Request, etc. and entering your Policy text in the rich text field which allows formatting, paragraph breaks, etc.

    Here’s an example of a filled-out Policy form:

    image2 

    There’s also the Policy XTP (template part) that allows easily adding policies into your forms. Here’s how it looks like in the Designer:

    image3 

    Add the XTP into your InfoPath Designer Custom Controls:

    image4 

    We will add the Policy XTP into the Expense Report form that ships with InfoPath 2007.

    image5 

    Follow the steps provided in the XTP – we made it very simple and user-friendly for you! J

    Key notes:

    • Make sure to enter the same form name you specified when you submitted the Policy Form. Recall that we submitted policy and gave it a Target Form Name of “Expense Report”

    image6

    The same name should be specified as the default value in the Policy XTP section’s TargetFormName field:

    image7 

    • In the PolicyLibraryUrl field, enter the URL to the library where you published the Policy Form to. Make sure to include the trailing slash, like so:

    image8

    • The XTP appended the “_Policy” text in the data connection names so you’ll need to rename the data connection for QdabraRules (only) so that FormsViewer recognizes the commands.

    image9

    Those are all the changes needed – super easy! J

    How the Magic Happens

    All the rules are placed in the Show Policy button:

    image10 

    We use the following commands/technique:

    • ChangeConnectionUrl – to change the URL of the BusinessProcess_Policy XML data connection

    image11

    We are basically telling our form to get the policy text from the Policy Form library to the form where we added the XTP to, in this case, the Expense Report form.

    • CopyRichText – if a policy has been submitted for our form, we then copy the value from that Policy form into our Expense Report form.

    image12

    Since we’re copying to and from a rich text field, we use the command CopyRichText in order to keep any rich text formatting.

    That’s all there is to it! When you’re done setting it up, publish your form into FormsViewer and test out your changes.

    image13 

    image14 

    Have fun! J 

  • Create a Child Form from within a Parent

    (Click here to download the files used in this blog post.) 

    Overview

    When you're designing a form, you don't need to include "everything but the kitchen sink”. I confess abusing this idiom in the past. It means "almost anything one can imagine". I have used "kitchen sink" as a metaphor for an InfoPath form from hell that has everything thrown into it. Visually, I imagine a kitchen sink so full that it is impossible to wash the dishes.

    It's easy for a form to become bloated and unwieldy.

    For example, imagine that you have a simple Expense Report form that submits to a SharePoint library. Good job! You publish and people start using it and they are happy for a month or so. Then, you get a feature request to add a simple approve-request workflow. So, you add a "Change History" section to your form (we have an XTP for this) and promote properties for the last modified user and date-time fields to integrate with a new SharePoint workflow. This makes sense because you can now measure the time between submit and approval or rejection and resubmit, etc. You can't do that with SharePoint workflows, so it makes sense to add this repeating block to your form. Fine. Another month goes by and somebody wants you to add a Expense Policy to the form. Now, you know that there are many business policies in your org and during a slow Tuesday afternoon you daydream of creating a general form for policies and linking them together but then when Wednesday rolls around, you're slammed with other work and you just don't have time to do that so you hard-code the policy into the form and that gets the job done, but you know you'll have to republish with every update. Let's hope the policy doesn’t change often.  After another month and yet more feature requests and suggestions, you finally put your hand to your head and in a flash of insight realize that whack-a-mole is the wrong game for you. Instead, you will design a place in your form where users can submit suggestions.  You will automate the task of improving your form and in the process get control of your work week back. You will schedule one time every two weeks to review form feedback and schedule changes. Life will be orderly.  Only one problem: how to extract suggestions saved in the Expense Report form…

    Here's where it makes sense to have two dishwashers. You've got one for glass stemware and another for pots and pans. Different cycles for different dirtiness. Your Expense Report form and Suggestions will be in different libraries. The Expense Reports need to be processed quickly. The suggestions, not so much. OK, that's the idea, but how to extract the latter suggestion from the former expense report and yet still give people a "ticket #" so that they feel like their suggestion didn't end up in the black hole of SharePoint?

    With Qdabra's easy-to-inject Suggestions XTP, you can add a Suggestions section to your form and have it saved to a separate library.

    Requirements

    • You are a site collection admin.
    • Your site has the FormsViewer App installed, or your SharePoint admin can install it.
    • You have an InfoPath form or access to InfoPath Designer to create one.

    Sample Scenario = Add a Suggestion Box to your form

    Adding a Suggestion Box to your form is a great way to capture feedback, and defuse negativity of a new process. If someone calls to say there's a bug, you can have them enter it into the suggestion box right away and promise them some turnaround.  They're happy you listened.

    qRules has a command called SubmitToSharePoint which users to create a different XML document and submit to a SharePoint form library. It supports “create” and “update” actions for XML fragments based on an XML mapping.

    How it Works

    This lab provides a Suggestion form and a Suggestion template part (XTP). If you open both in InfoPath Designer and compare the Suggestion form’s main schema against the XTP’s Suggestion secondary data source schema side-by-side, you’ll see that the XTP contains the schema of the Suggestion form.

    Suggestion Form:

    Suggestion XTP:

    When you add the Suggestion XTP into your form, the XTP will add the schema as an XML to the secondary data source.

    Design the Form that Submits Suggestions

    For your convenience, we are providing a sample form template that you can start with. You will continue designing this form as if it’s one of your company’s solutions.

    1. In InfoPath Designer, open the template named xsn.
    2. Add your fields and controls – you can add any field you want; but for the purpose of this exercise, we’ll add fields for Suggestion, Project, Submitter, and FormName; and use text box controls on the canvas.

    1. Publish the form to a Library.
      1. Click File Publish SharePoint Server.
      2. Enter the training site URL (https://training2013.formsboard.com/MastersCourse/). Click Next.
      3. Select Form Library and click Next.
      4. Select Create a new form library and click Next.
      5. Enter a unique name for your form library. For example, <YourName>_Part12_Lab1.
      6. Click Next twice and Publish.
    2. Add your Submit and Close buttons

    1. Create a Submit to Library data connection
      1. Under the Data tab, click Data Connections.
      2. Add a Submit data connection that submits To a Document Library on a SharePoint site.
      3. Enter the URL for the library created in step 3.
      4. For the File name, click the fx button and select the FormName
      5. Click Next until you reach the last page of the data connection wizard.
      6. Leave the SharePoint Library Submit name as is, and click Finish to exit the data connection wizard.
    2. Double click the Submitter field, click the fx button, and enter the formula userName().
    3. Click on the Submit button.
    4. Under the Home tab, click Manage Rules.
    5. Add an action rule named Generate FormName.
    6. Click the Condition
    7. For the first dropdown, select the FormName
    8. Select “is blank” from the second dropdown.

    1. Add an action that sets the FormName field

    1. Click the fx button and enter the formula: translate(concat(Project, "-", Submitter, "-", now()), ' ~#%&*{}<>:,?\/|"+.…', "_____________________")
    2. Highlight Project and click the button Insert Field or Group
    3. Select the corresponding Project field and perform the same step for the Submitter
    4. Click OK
    5. Add another action rule that Submits Data using the SharePoint Library Submit data connection, and name the rule accordingly.
    6. Save the form and click the quick publish icon  located at the upper left section of your screen to perform a quick republish.
    7. Perform a test submit to verify the submit works – the XML generated will be used for identifying the Processing Instructions of the XML.
    8. Download the generated XML and save it on your desktop or downloads folder. 

    Add the Suggestion XTP

    You will then add the Suggestion XTP that will allow suggestions to be submitted into the target Library we created earlier.

    In this section, you may use any form you wish to use but for purposes of training, a QdExpenseReport-Sample pre-injected with qRules form has been provided.

    Note that qRules is required. You may need to inject your form with qRules if you are using a different form.

    1. Add the XTP in InfoPath Custom Controls.

    1. Drag the Suggestion XTP on your form canvas.

    This is how the XTP looks like on the design canvas:

    In your Fields task pane, notice that the XTP added groups and fields into your main data source.

    If you go to Data > Data Connections, you will see that the XTP also added data connections:

    And if you select the Submit Suggestion button then display the Rules task pane via Home > Manage Rules, you’ll see the pre-configured rules:

    These are just some of the benefits of using XML Template parts (XTPs) – it adds almost everything for you; in short, you let the XTP do the hard work. Another huge plus is that you can use XTPs in as many forms as you want.

    Modify the XTP

    We will make a few modifications to the Suggestion section so that it meets our form’s needs.

    1. Move the light bulb icon (drag-and-drop) where you want it to appear on your form.

    1. Add data connection that submits to the Suggestion Form library.
      1. Under the Data tab, click Data Connections.
      2. Add a Submit data connection that submits To a Document Library on a SharePoint site.
      3. Enter the URL for the Suggestion Form library.
      4. For the File name, click the fx button and select the node /ns1:SuggestionForm/ns1:FormName from the Suggestion_ Suggestion secondary data connection.
      5. Click Next until you reach the last page of the data connection wizard.
      6. Provide a meaningful name such as SubmitSuggestion, and click Finish to exit the data connection wizard.
    2. Click Submit Suggestion button
      1. Modify Action rule named Insert PIs - set target field to qRules Command node for both actions.
      2. Modify Action rule named Submit to Suggestion Library - set target field to qRules Command node
    3. At the Xtp_Logic_Suggestion secondary data connection, click the node /XtpLogic/Action/SetXMLValues
      1. Modify Action rule name Set Library Name* - set Value to the Library name of the Suggestion Form (not the Expense report form)
      2. Modify Action rule name Set URN* - set Value to the URN of the Suggestion Form
        1. Open Suggestion Form in deign mode
        2. Go to File > Info > Form template Properties
        3. Copy the URN from the ID section
        4. Exit form
    4. Back at the Submit Suggestion
      1. Click the first rule named Set Values.
        1. Modify the value of the action that sets the Project field to a value you desire – this should correspond to the current form you are adding the submit suggestion xtp to.

      2. Modify the second rule named Insert PIs.
        1. Open the XML saved in step 21 using a text editor such as notepad.
        2. On the first action, update the corresponding values for the following Processing Instruction attributes:
          • solutionVersion
          • productVersion
          • PIVersion

        3. On the second action, verify if the values for the /data parameter are the same. If not, update the attribute values accordingly
          • InsertPi /dsname=Suggestion_Suggestion /name=mso-application /update=true /data=progid="InfoPath.Document" versionProgid="InfoPath.Document.3"
        4. Double check the /dssubmit parameter value – make sure that the value is the same as the Submit to Library data connection name create in step 25 g. By default this should be: SubmitSuggestion
    5. Save your final template.

    See it In Action!

    Now that we have set it all up, we are ready to test our solution.

    1. Publish your form template to SharePoint by creating a new Library (see step 5 for reference).
    2. After Publishing the form, Open a  new document.
    3. Submit a suggestion.
      1. Click on the light bulb icon where you placed it.
      2. The Suggestion box should appear – fill in the fields.
      3. Click on the Submit Suggestion

    1. You should see a link to the submitted suggestion.

    1. Click on the link to open the Suggestion form that you just submitted.

     

  • Send a Form Link via Workflow

    Overview

    How about approving workflow requests via email with one click?

    With Qdabra's easy-to-install FormsViewer app, you can do this and more.

    Wouldn't it make even more sense to approve workflows from a phone without having to login to SharePoint?

    Well, now with FormsViewer, even external users can approve requests. One click. No log in required.

    Faster, better, easier - that's FormsViewer!

    Important: please don't attempt this while driving.

    Requirements

    You are a site collection admin.

    Your site has the FormsViewer App installed, or your SharePoint admin can install it.

    You have an InfoPath form or access to InfoPath Designer to create one.

    Sample Scenario = Leave Requests

    A Leave Request form is a common scenario where approvals are required.

    Steps 

    Employee requests personal time off (PTO)

    1. Employee navigates to HR site

    2. Employee clicks on Submit Leave Request

    3. Employee fills out form and submits

    Manager is notified

    1. Manager receives an email summarizing the PTO request

    2. Manager clicks on link to approve or reject request

    Components

    To implement, you will need the following:

    • One Leave Request form (InfoPath)

    • One Manage Leave Request form (InfoPath)

    • One SharePoint 2010/2013 workflow

    Note: You can download and install our Leave Request solution from the Qdabra web store here:
    http://www.qdabra.com/webstore/p/1152/leave-requests-form

     

    Technique

    To approve or reject a request with one click, you need to tell the form whether you are "approving" or "rejecting" when you click. So, there are two links. One link has "&Approval=Approved" and the other has "&Approval=Rejected".

    To create these links and send an email we will use SharePoint Designer…

    Here's the workflow:

    image1

    Here's the email:

    image2

    Here's the link for "Approved":

    image3

    image4

    To create a link for rejecting, you just change the "&Approval=Approved" to "&Approval=Rejected".

    Now, let's take a look at the form.

    Qdabra's Leave Requests solution has a form for submitting requests (Leave Requests form) and a form for managing the leave requests. Both are included in the package.

    The workflow that sends emails with the approve-reject links is associated with the former Leave Requests form.

    But, the links themselves point to the latter Manage Leave Requests form.

    The Manage Leave Requests form opens when the manager clicks the link and there is logic after form load that sets the approval status based on the command that was passed.

    Here's how the form canvas looks like in InfoPath Designer:

    image5a 

    Here are the rules that get the approval status:

    image5b 

    Notice that we are using the qRules command "GetInputParameter" to query the link for the Approval key. This key indicates whether the manager has "approved" or "rejected" the request.

    After obtaining the approval status, we next need to get the ID of the form:

    image6

    Once again, we are using the qRules GetInputParameter command to query the form's ID from the link.

    After getting the link, we can query the form:

    image7

    Notice that the rule queries the form from the Leave Requests library - that is where it was submitted.

    Next, the form updates the library based on the approval.

    image8

    That's all there is to it.

    Just create a workflow link that appends the form's ID and the Approval command. Then, in the form use qRules GetInputParameter to query these values from the link and perform some actions based on what they are.

    To do this even if the user is not logged in, just add one more parameter:

    image9

    Of course, you'll want to look at the samples. :)

  • Get rid of that "Control binding is not supported" error on your Design Checker!

    Got calculated values on your InfoPath browser form? Do they involve filters and/or complex formulas? Surprised to find out that as soon as you're ready to publish your form, there goes the Design Checker error on the taskpane --- "Control binding is not supported"

    Hilary, one of our InfoPath experts, blogged something about this - here's her post. She suggested a workaround of manually modifying the form source files which wondefully works. Her readers asked if there's a way to do this without tinkering with the source - there is indeed! And it is easy... read on!

    To reproduce the scenario and better understand when this issue actually occurs, create a simple form by following these steps:

    1. Add a repeating table with 2 columns.
    2. Add a calculated value control and set it to display the repeating group's field1 node - we know that this will display only the first row's field1 value, but we won't care about that for now.
    3. Go to File > Design Checker --- no errors, good! Not surprising, but good.
    4. Add another calculated value control - the value this time will be the field1 node filtered when field2 is not blank. So you'd select Calculated Value from the Controls menu > click on the fx button > Insert Field or Group > select field1 > Filter Data > Add > field2 is not blank > click OK five times.

      Here's what we have so far:

      Let's preview the form to make sure it's working so far...


    5. Close Preview and click Refresh on the Design Checker pane - still no error...

      And here's where we try reproducing the issue - we'll make that design checker error appear...

    6. Right-click on the first calculated value's control and select Calculated Value Properties > click on the fx button and just click OK twice to close it without changing anything - just humor me here, ok? Now click Refresh again - no error.
    7. Repeat the same actions on Step 6, this time with the second calculated value --- so look at the formula in the properties dialog box, don't change anything and hit OK to close it.

    Click Refresh --- bam! There's your error.

    At this point, we'll wonder - is it a bug in InfoPath? I don't know. But here's where I think Hilary's observation comes to play - it might've already added that "xd:binding" attribute in the xsl file as soon as we clicked OK, InfoPath thinking that we "modified" it. If you Undo once from that last step and refresh again, the error will go away. But who can keep track? (Note to self: don't click OK in edit mode dialogs when I really did not change anything - there's a Cancel button after all!)

    The solution, aside from manually modifying the source files, is to ---- delete the calculated value and add a fresh one! Yes! But before you delete, make sure to grab your formula first - copy it, so that you won't need to rebuild it on your fresh calculated value as you can just paste the expression in the formula box. Now that's easy enough, at least for me.

    So we know that this will occur everytime you'd go to the formula and edit it (what a pain). Again, who can keep track? The goodness left in this is that InfoPath will still be friendly enough to point all instances of this error when it's time to publish your form. So keep working, just keep adding your calculated values, modify them all you want. When you publish, you'd end up with 10 or more errors like this, but when you click on each, your cursor will point to the exact calculated value that needs to be recreated. You can then fix them all at once.

    Hope this helps...

  • Add a dog ear to your form

    From this:

     

    To this:

     

    That looks like a "dog ear" to me, pretty much.

    Adding this requires a little knowledge with Adobe Photoshop, but the steps should be straight-forward. So, if you're ready – grab the PSD file here.

    1. Open QdHeader.psd in Adobe Photoshop.

    2. From the Layers pane, select Corner.

     

    This will select the "dog ear" image from the canvas.

     

    3. From the vertical toolbar menu, set the foreground color to your desired border color – let's pick red for this example.

     

    4. Select the paint bucket tool.

     

    5. Click the border portion of the dog ear to color it.

       

    6. Repeat the same steps for the right, left and top borders, selecting the layer first and then using the paint bucket tool to change the color.

    7. You can change the remaining yellow-colored portion of the "dog ear" to match your form view's background color, like so

     

    8. You can also change the gradient overlay color to match your desired theme:

     

    9. Finally, add your company logo, slogan, etc. to add branding to your form.

     

    10. That's it! You can just save the file as an image and add it to your form.

    You should now have a very neat header for use in all your forms. Enjoy!

  • Show unique rows in a secondary repeating data source table - no code!

    When designing an InfoPath form that integrates with a secondary data source such as a SharePoint list, data retrieved from SQL, or a simple XML document – you may find yourself needing to hide rows that have the same value/s as that in your main data source.

    There might already be written blogs out there demonstrating techniques on how to do this such as Greg’s and Matt’s – both show different techniques on how to filter a dropdown list showing only unique selections; but I haven’t been able to find an exact article on how to hide the entire row in a repeating table coming from my secondary data source itself.

    In a recent project, I’ve used a technique that does just this and it really is so simple so it might be worth a share. Oh, and take note --- this works like a charm using just one conditional formatting, no code at all! Interested? Follow along…

    To simulate the scenario, let’s create an XML document that lists some fruits:

    <?xml version="1.0" encoding="UTF-8"?>

    <items>
        <item>Apple</item>
        <item>Banana</item>
        <item>Orange</item>
        <item>Lemon</item>
        <item>Kiwi</item>
    </items>

    We’ll use this as our secondary data source. Save it as an XML file.

    We’ll then design a simple InfoPath form template, adding the XML file as a secondary receive data connection that automatically retrieves data on form open – we’ll call it “Fruits”.

    image

    This should be displayed in the Fields task pane like so:

    image

    And then we’ll add the main data source:

    image

    Next, drag the main data source Item group as a repeating table on the canvas, as well as the item repeating group from the XML secondary data source – add headings to differentiate the two sources, like so:

    image

    We’ll now add the key ingredient!

    First, select the item repeating group from Fruits (Secondary) data source – this is where we’ll add the conditional formatting. Display the Rules by clicking Manage Rules under the Home tab and once displayed, click New > Formatting.

    On the Condition window, leave the first and the second dropdown selections to the item field of the Fruits (Secondary) data source and as “is equal to”, respectively; then on the third dropdown, choose “Select a field or group…”

    SNAGHTML11c3da06

    Select the Fruit field from the main data source.

    image

    Click OK as many times needed to close all dialog boxes and then check the Hide this control box. Your conditional formatting rule should look similar to this:

    image

    And now, the fun part – testing your form! On preview mode, it should look like this:

    image

    Begin inserting item/s in the main data source and see for yourself, how simple it is to hide those secondary data source rows that has matching values in the main data source!

    image

    Have I mentioned it’s simple? Smile

  • How to Create a Digital Certificate and Publish a Signed Template to the DBXL Admin Tool

    Because InfoPath 2010 digital certificates are only good for a month, we will use the Digital Certificate for VBA Projects tool to create one that will last several years. You could also use InfoPath 2007 or 2003 (if available) as these both produce digital certificates that last many years. Your safest route for production is to get your digital certificate from a Certificate Authority.

    Create a Digital Certificate

    To create a digital certificate:

    1.       Open the Windows Start Menu.

    2.       Navigate to All Programs | Microsoft Office | Microsoft Office Tools.

    3.       Click Digital Certificate for VBA Projects.

    4.       In the Create Digital Certificate dialog box, type InfoPath Certificate, and then click OK.

    clip_image001

    Publish a Signed Template to the DBXL Admin Tool

    Publish an unsigned template using the following steps:

    1.       Publish an unsigned template from the InfoPath designer (we’ll sign it at a later step).

    2.       Launch the DBXL Admin Tool (DAT).

    3.       Create or edit the Document Type Configuration for your template.

    4.       Attach your InfoPath template, and ensure to clear the check box labeled Form Template Is Signed.

    clip_image002

    5.       Save your Document Type.

    6.       Click OK when the Changes Saved message appears.

    Save and sign your template using the following steps:

    1.       Right-click the saved XSN file and choose Save As.
    NOTE: Be sure the file extension is present (i.e. it you should be saving “My InfoPath Template.xsn” and not “My InfoPath Template”).

    2.       Choose a location to save your unsigned published template, and then click Save.

    3.       Locate and right-click your saved form, and choose Design.

    4.       On the File tab, click Form Options.

    clip_image003

    5.       Select Security And Trust in the Category list.

    6.       Clear the check box labeled Automatically Determine Security Level, and then choose Full Trust.

    7.       Select the check box labeled Sign This Form Template, and then click Select Certificate.

    8.       Select the InfoPath Certificate you created earlier, and then click OK.

    clip_image005 

    9.       Click OK.

    10.   Save (not publish) your signed form (overwrite previous template or save as with new name).

    Republish your signed form using the following steps:

    1.       In the DAT, you should still be editing your Document Type.

    2.       Right-click the XSN File, and choose Attach.

    3.       Locate and select your signed template, and then click Open.

    4.       Select the check box labeled Form Template Is Signed.

    5.       Click Save.

    clip_image006 

    Install the Digital Certificate

    A. If you are the user who created this digital certificate and this is the first time you are opening a form template that uses it:

    1.       Click the green-arrow download button to launch the form template.

    2.       If prompted, click Open:

    clip_image007

    3.       When presented with the certificate dialog, click Trust All Documents From This Publisher.

    clip_image008

     

    B. If you are a user other than the one who created the digital certificate and this is the first time you are opening a form template that uses it:

    1.       Open the form from the DAT (not the DBXL Dashboard).

    2.       If prompted, click Open:

    clip_image007[1]

    3.       When presented with the certificate dialog, the Trust All Documents From This Publisher button is grayed out. Click the Show Signature Details link.

    clip_image009

    4.       On the Digital Signature Details dialog box, click View Certificate.

    5.       On the Certificate dialog box, click Install Certificate.

    6.       In the Certificate Import Wizard, click Next.

    7.       Select Place All Certificates In The Following Store, click Browse, select Trusted Root Certification Authorities, and then click OK.

    clip_image010

    8.       Click Next, and then click Finish. 

    9.       On the Security Warning dialog box, click Yes, and then click OK to the successful import message.

    clip_image011

    10.   Click OK, then OK, and then click Open.

    11.   Now close the InfoPath form template and reopen it. You will once again be presented with the InfoPath Editor Security Notice, but this time click Trust All Documents From This Publisher.

    clip_image012

  • How to Use Report Builder to Build Queries and Retrieve Data from DBXL

    “Would you like to create detailed reports from your XML data without going to the trouble of creating a database mapping? With DBXL v2.5 and Report Builder, now you can.”

    In this blog post, I’ll detail the steps on how to do simple XML reporting in your forms, using DBXL’s QueryDocumentsNodeSet and the Report Builder tool:

            Extract data from your InfoPath forms even if you don’t have a database mapping

            Build your queries using DBXL v2.5’s Report Builder tool

            Export the results to Excel for pivoting and charting

    Publish a sample InfoPath form to DBXL

    1.       Download the sample InfoPath form template (CompanyContactInfo.xsn) – this is a simple InfoPath form that has a few fields and allows submit to DBXL via the SubmitDocument operation.

    2.       Open the form template in InfoPath Designer.

    3.       Go to File > Save As and save the XSN locally.

    4.       Launch the DBXL Administration Tool (DAT) from your local Database Accelerator Control Panel (the access URL would typically be in the format http://localhost:8000/QdabraWebService/default.htm).

    5.       Create a new document type configuration – give it a descriptive name and then attach your XSN. When done, click Save.

    image

    6.       Click on the Open link to open a new form using the template. Fill out and submit at least three to four documents.

    image

    Build your queries using the Report Builder tool

    7.       Download the Report Builder tool via this link.

    8.       To install, first make sure that InfoPath is not running (close all active InfoPath windows); run a command prompt as an administrator, change the directory to the location of your installation files, and then execute install.js

    image

    9.       Launch the tool by opening InfoPath, clicking New and selecting Qdabra Report Builder listed under the Installed Forms section.

    image

    10.   In the General section of the Report Builder tool, enter the Web Service URL Prefix, e.g. http://localhost:8000.

    11.   Enter QdabraWebService as the Web Service Name and then click Connect.

    image

    12.   Start building your query by clicking Add Query > Create in the Queries table.

    image

    13.   Select the document type you created in Step 5.

    image

    14.   Click on the Schema icon (image) – this will display the custom task pane at the right, double-click on the root node which in our sample XSN is  /my:myFields.

    15.   Click Insert Item and start adding the fields you wish to retrieve. Give each field an alias which will be the label/title in the Excel report for that particular field/column. Note that we can’t use spaces in aliases.

    image

    Notice the Query XML section – here, you’ll see the query string we’ll be using to retrieve the data using DBXL web service QueryDocumentsNodeSet operation later on. Copy this string and paste it in Notepad for now.

    16.   Click Perform Query – you’ll be taken to the Query All tab, click on the left arrow key (image) to expand and see the query result, like such:

    image

    You can click on the Export All Queries to Excel should you wish to use the data in Excel and do reporting.

    image

    Use QueryDocumentsNodeSet to auto-populate dropdowns

    We can now use the DBXL’s web service method called QueryDocumentsNodeSet to retrieve data in a form from another form.

    17.   In InfoPath Designer, create a new blank form.

    18.   Go to Data > Data Connections > Add and add a data connection that retrieves data from a SOAP Web service.

    19.   The URL to the DBXL Document Service would be in the format: http://<DBXLServer>/QdabraWebService/DbxlDocumentService.asmx, where <DBXLServer> is the machine where DBXL is installed (in this case, your local machine):

    image

    20.   Select QueryDocumentsNodeSet from the list of operations.

    image

    21.   Set Sample Value of the tns:query parameter to the query string generated by Report Builder – remember that you’ve pasted this in Notepad earlier.

    image

    22.   Click Next twice; give the data connection a descriptive name and then uncheck the box ‘Automatically retrieve data when form is opened’.

    image

    23.   Click Finish > Close to exit out of the Data Connections wizard.

    24.   In the Fields task pane, add a new field called Company – display this on the canvas in a dropdown list box control, like so:

    image

    25.   Right-click on the dropdown and select Drop-Down List Box Properties.

    26.   Change the List box choices selection to Get choices from an external data source. The data source will default to the one you just added.

    27.   Click on the icon next to Entries and then expand the nodes until you see the Company node – select that.

    image

    28.   You might want to check the box ‘Show only entries with unique display names’ in case you have multiple entries with the same value.

    image

    29.   Next, we’ll add form load rules that first sets the query string and then queries the data connection.

    a.       From the InfoPath Designer menu, go to Data > Form Load

    image

    b.      In the Rules task pane that appears, click New > Action > Add > Set a field’s value.

    c.       Allow the action to set the query parameter of the QueryCompanies secondary data source, to the query string generated by the Report Builder (again, you pasted this in Notepad).

    image

    d.      Add another action in the same rule that queries for data in the QueryCompanies data connection.

    image

    30.   Preview your form template – your dropdown should auto-populate with data from your DBXL doctype:

    image

    There’s your form data from another form – no database queries/mapping involved!

  • Make that repeating group display two rows per item instead of just one!

    The default Expense Report form that’s shipped with InfoPath 2007 makes use of a table that shows the expense item details per row. Your requirement is to add a new field where users can enter notes or comments for that particular expense item – you’d like to display this new field underneath the already-existing row in the table, therefore having 2 rows for each item now.

    The technique used in this blog doesn’t only apply to the Expense Report form but to all others where you’d want to show two rows per item in a repeating group, instead of just one.

    Adding a new field is easy:

    1. In your main data source, locate the items group > item repeating group and add a new field called notes (you can set it either as Text (string) data type or a Rich Text (XHTML) depending on your requirement).

     

    Your main data source should look similar to this:


    The tricky part is the layout – displaying the controls in two separate rows, and making the header/footer not repeat like how it is in a repeating table.

    To achieve the layout we want, we need to skip using a repeating table and use a repeating section instead. Follow along…

    2. Place your cursor where you want to display the section on the canvas - the Itemized Expenses layout table would probably be your pick. Don’t delete the existing repeating table just yet so you can copy/paste or drag/drop some items over later.

    3. In the Data Source taskpane, right-click on the items parent group and select Section – this will insert a section right where your cursor is on the canvas. Set this section’s padding to 0px to get rid of the unnecessary white spaces inside the section and that all its contents will stay as close to the edges as possible.


    4. With your cursor placed inside the newly-added section, go to the Table menu > Insert > Layout Table… and insert a 5 columns by 3 rows table.

    You may specify the number of columns you want depending on the fields you want to display. We’re adding 3 rows however, so we’ll have the top row for our table header, 2nd row for the repeating section that will hold the expense item details (so merge the cells to make it 1 whole row without columns), and the 3rd for the total amount of the expenses.

     

    5. Place your cursor in the second row (the one you just merged) and again, set all the paddings to 0px.


    6. Without moving your cursor where it’s at, right-click on the items repeating group and then select Repeating Section. This time, set all its paddings and margins to 0px.

     

    In InfoPath 2007, sections and repeating sections have some kind of invisible borders by default. Remove this by selecting the repeating section, and selecting None in the Borders and Shading dialog.


    Again, we’re doing all this to eliminate all the white spaces as possible in order to achieve that all-in-the-same table effect (like what a repeating table would give) even though we’re using a repeating section.

    7. With your cursor still inside the repeating section, insert a 5 columns by 2 rows table. The 1st row will hold the default details (Date, Description, Category, Cost and the arrow button) while the second is for the new notes field.

    8. Add the controls inside the table (you can drag and drop from the existing repeating table and delete it afterwards).

    Adjust the formatting to your liking – resize the cells making sure that all the columns and rows are perfectly aligned, fix the paddings and margins, add borders/shading, etc.

    Your layout might look similar to this:


    And in Preview, something like this isn’t bad at all:


    Have fun! :)

  • qRules: Videos and Documentation Links

  • New! qRules v2.4 Form Flags Sample Form

     The qRules Form Flags sample form features the following qRules Commands:

    • IsNew - checks if form is new and sets the form version to '0'. This form version increments as changes are made to the form.
    • IsDirty - checks if the form has changed. If there are no changes and user clicks Save/Submit, the form will not save/submit to the server.
    • SetDirty - resets the IsDirty flag to 'false' on successful submit to allow further changes the next time the form is opened.
    • IsReadOnly - checks if the form is currently opened by another user and prevents save/submit if so.
    • ClearErrors - clears validation errors to allow users to save the form regardless if the required fields have been completed or not.
    • GetErrorCount - counts the number of validation errors in the form; if present, users will not be allowed to submit.
    • SetCaption - sets the form title to the form's name in the SharePoint library.
    • SetSave - prevents File > Save to the SharePoint library.
    • Bonus:
      • Checks if a newer version exists on the server.
      • Detects the form status (Saved/Submitted), version and DocID which are all displayed on the form's footer.
    Click here to download the sample form.
  • Free Training: Using InfoPath Workflow

    You may be familiar with SharePoint workflow, but have you added workflow to an InfoPath template? InfoPath workflow is easier to use because it's handled in InfoPath instead of requiring the user to complete certain actions in SharePoint.

    Users can easily see the state of the form and you can add custom conditional viewing to switch views based on the user role (e.g. a private Comments section in a Manager's view).

    During this lab, you will modify a Timesheet form template to pull user information from Active Directory, submit to SharePoint, and pass the SharePoint link in the notification email.

    Retrieving the Users' Active Directory Information

    If you go to Data > Data Connections, you'll see the pre-configured data connections that use Qdabra DBXL's Active Directory Web Service methods to retrieve the users' information.

    And if you go to Data > Form Load, you will see a rule that populates the user info:

    We're basically setting the fields in our form to the values retrieved from the Active Directory web service methods and using filters to specify which Key to use.

    Add the Submit Data Connections

    Start by modifying the starter template to add data connections that submit the form to SharePoint and through email.

    1.       Open the Starter Template XSN (included in this lab) in InfoPath Designer.

    2.       Save the template on your local machine by going to File > Save As and saving it with the name Timesheet.xsn

    3.       Add the data connection to submit to your SharePoint library.

    a.    Go to Data > Data Connections > Add > Create a new connection to submit data > To a document library on a SharePoint site

    b.    Enter the name of your document library, such as http://training.qdabra.com/personal/<<username>>/

    c.    For the File Name, click on the fx button and insert the formula:

    concat(tc:week/tc:weekOf, " - ", tc:employee/tc:name/tc:singleName)

    If you click on the Verify Formula button, you should see the following:

    d.    Click OK in the Insert Formula dialog.

    e.    Check the box ‘Allow overwrite if the file exists'.

    f.    Click Next, leave the default data connection name, and then click Finish.

    4.       Add an email submit data connection.

    a.    In the Data Connections dialog, click Add > Create a new connection to submit data > As an email message

    b.    Click on the fx button next to the To field and select the emailto field which you'll find under the my:actions group in the main data source.

    c.    Click on the fx button next to the Subject field and enter the formula:

    concat("Time Card: ", tc:week/tc:weekOf, " - ", tc:employee/tc:name/tc:singleName, " has been ", my:actions/my:status, " by ", my:actions/my:modifiedby, ".")

    If you click on the Verify Formula button, you should see the following:

    d.    Click OK in the Insert Formula dialog and then click Next.

    e.    Make sure that the option ‘Send only the active view of the form and no attachment' is selected.

    f.    Click Next, leave the default data connection name, and then click Finish.

    5.       Click Close to exit out of the Data Connections wizard.

    Add the Rules that Trigger the workFlow

    In the Employee (default) view, you'll see a Submit button. This button will have rules that will set the form fields' values that are being used in the workflow, such as who modified the form, whom is it assigned to after the form submits, which email address should it be sent to, etc. Same goes for the Approve and the Reject buttons which you'll find in the Manager view - they have rules that trigger the workflow.

    Since the form also has a Form History section for tracking purposes, you may find other rules that set the history data. These have already been added in the form so we can concentrate on implementing the logic that is associated with the workflow.

    Start by modifying the Submit button:

    6.       In the Employee view, click on the Submit button.

    7.       From the Home tab > Rules section, click Manage Rules to display the Rules taskpane.

    You will see the following pre-configured rules:

    8.       Add a rule that sets the metadata

    a.    In the Rules taskpane, click New > Action.

    b.    Name your rule ‘Set Metadata'.

    c.    Move the rule up so that it's the third in the set, i.e. after the rule ‘Warn: Need Hours'.

    d.    Set the modifiedby field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select modifiedby under the my:actions group:

    iii.    For the value, click on the fx button and select singlename under employee > name

    You can also just enter the following XPath in the Insert Formula dialog: tc:employee/tc:name/tc:singleName

    iv.    Click OK to close the dialogs.

    e.    Set the assignedto field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select assignedto under the my:actions group.

    iii.    For the value, click on the fx button and select singlename under employee > name.

    iv.    Click OK to close the dialogs.

    f.    Set the emailto field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select emailto under the my:actions group.

    iii.    For the value, click on the fx button and select emailAddressPrimary under company > contact. You can also just enter the following XPath in the Insert Formula dialog: tc:company/tc:contact/tc:emailAddressPrimary

    iv.    Click OK to close the dialogs.

    g.    Set the status field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select status under the my:actions group.

    iii.    For the value, enter the text Submitted

    iv.    Click OK.

    h.    Set the notes field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select notes under the my:actions group.

    iii.    For the value, enter the text Submitted to Manager

    iv.    Click OK.

    You should now have the following Submit button rules that set the metadata:

    9.       Add a rule that submits the form:

    a.    Click New > Action.

    b.    Name your rule ‘Submit' - this will be the last rule in the set.

    c.    Submit to SharePoint:

    i.    Click Add > Submit data.

    ii.    Select your SharePoint Library submit data connection from the drop-down:

    iii.    Click OK.

    d.    Set the done field:

    i.    Click Add > Set a field's value.

    ii.    For the field, select done under the my:actions group.

    iii.    For the value, enter 1

    iv.    Click OK.

    Notice the conditional formatting in the Submit button:

    This means that we want the Submit button to be disabled if the value of the done field equals "1" which we set after the form submits to SharePoint. This will prevent users from clicking on the Submit button twice which may result to double-submits.

    e.    Submit via email:

    i.    Click Add > Submit data.

    ii.    Select your email submit data connection from the drop-down.

    iii.    Click OK.

    f.    Close the form:

    i.    Click Add > Close the form.

    ii.    Uncheck the box ‘If changes have not been saved, prompt the user to save.

    iii.    Click OK.

    You should now have the following Submit button rules that submit the form:

    Next, we will add rules in the Approve button:

    10.    Go to the Page Design tab and switch to the Manager view.

    11.    In the Manager view, click on the Approve button. You will see the following pre-configured rules:

    12.    Add a rule that sets the metadata.

    a.    In the Rules taskpane, click New > Action.

    b.    Name your rule ‘Set Metadata'.

    c.    Move the rule up so that it's the second in the set, i.e. after the rule ‘Warn: Need Notes'.

    d.    Add the following actions:

    13.    Add a rule that submits the form:

    a.    Click New > Action.

    b.    Name your rule ‘Submit' - this will be the last rule in the set.

    c.    Add the following actions:

    Finally, we'll add rules for the Reject button:

    14.    In the Manager view, click on the Reject button.

    15.    Add the same ‘Set Metadata' rule that runs after the ‘Warn:Need Notes' rule.

    16.    Add the following actions:

    17.    Add a Submit rule which is the last in the set, and then add the following actions:

    18. Save your changes to your XSN.

    Create the Form Link

    We will add a hyperlink control that links to the form in SharePoint. The link will be included in the notification email so that users can click on it to open the form.

    19.    In the Manager view, you'll see a small section at the bottom. Place your cursor below the label ‘Click here to open this time card:'

    20.    Go to the Insert tab and click Hyperlink.

    21.    In the Insert Hyperlink dialog, change the Link to and the Display options to Data Source.

    22.    Insert the formula:

    concat(substring-before(substring-after(/processing-instruction()[local-name() = "mso-infoPathSolution"], 'href="'), "/Forms/"), "/", tc:week/tc:weekOf, " - ", tc:employee/tc:name/tc:singleName, ".xml")

    The formula is a concatenation of the form location in SharePoint, e.g. http://<YourSharePointSite>/<YourSharePointLibrary>/<FormFileName.xml>

    Recall that we've set the form file name to this formula on SharePoint submit:

    Publish the Template to your SharePoint Library

    In order to access the form template and submit forms, you need to publish it to a location where users can access it from, such as a SharePoint form library.

    23.    Go to File > Publish and then select SharePoint Server.

    24.    Enter the URL to your SharePoint site.

    25.    Leave the default to Form Library and then click Next.

    26.    Select ‘Update existing form library' and select the SharePoint library you created earlier - that is, where you've set your forms to submit to.

    27.    Click click Next twice, click Publish, and then click Close.

    Test by submitting a new Timesheet form assigning it to your manager. Your manager will receive the form via email and will see a link where to access the form.

    The manager will then open the form via the link and will decide whether to approve or reject. Approving goes to HR and rejecting goes back to the original submitter.

  • Free Training: Data-Driven Design - Using XML Files to Configure Other Forms (Lab 2)

    In this lab, your business process has evolved and you have many more questions and answers. You decide using a configuration form is more efficient so you'll modify your Quiz Form from Lab 1. In real life, you could also create a form that pulls from a configuration form without going through the steps in Lab 1.

    Create a Form out of your Template

    1.       Open your Quiz Form template in InfoPath Designer.

    To make sure you are not overwriting your template for Lab 1, change the title and save it with a different name.

    2.       Preview your form template, go to File > Save As and save it as Config.xml. This will save the schema as well as the default data in an XML format.

    3.       Close Preview.

    Add a Data Connection to the XML File

    We are going to add our new configuration XML as a resource to our template.

    4.       Go to the Data tab > Data Connections, and then click Add.

    5.       Add a data connection that receives data from an XML document.

    6.       Browse to the Config.xml file saved earlier.

    7.       Click Next twice leaving the default selections, click Finish and then click Close.

    Change the Drop-Down to get Choices from the Secondary Data Source

    8.       Modify the data source for the SelectedModule drop-down list box to use the default Modules in the new Config data source:

    a.   Right-click on the SelectedModule drop-down and select Drop-Down List Box Properties.

    b.   Change List box choices to Get choices from an external data source. The Data source will default to the Config data connection you created earlier:

    c.   Click on the icon next to Entries, select the Module repeating group under Modules and then click OK.

    d.   Leave Value set to my:ModuleNo, but change Display name to my:ModuleName, and then click OK.

    Use InfoPath Functions to Get Row Numbers

    In this section, we will use the built-in InfoPath functions count and preceding-sibling to create row counts for the Module and the Question repeating groups. We will use these row counts as default values to the ModuleNo and the QuestionNo fields. We will then use a formula to auto-increment the fields as we add new rows to the repeating groups.

    9.       Set the default value of the ModuleNo field.

    a.   In the Fields taskpane, double-click on the ModuleNo field to display its properties.

    b.   Under Default Value, click on the fx button next to the Value box.

    c.   Enter the formula: count(../preceding-sibling::my:Module) + 1

    d.   Click Verify Formula and you'll see this:

    e.   Click OK twice.

    10.    Set the default value of the QuestionNo field.

    a.   In the Fields taskpane, double-click on the QuestionNo field to display its properties.

    b.   Under Default Value, click on the fx button next to the Value box.

    c.   Enter the formula: count(../preceding-sibling::my:Question) + 1

    Change the Default Values to Pull Data from the Secondary Data Source

    In the Fields taskpane, if you double-click on the ModuleName field of the main data source to see its properties, you will see the the default value you've manually added from Lab 1. We will change this value to pull from the configuration file instead.

    11.    Click on the fx button and then click Insert Field or Group...

    12.    Switch to the Config (Secondary) data source and follow the series of steps shown in the image below to select and filter the ModuleName field.

    13.    Click OK four times.

    If you check the Edit XPath (advanced) box, you'll see the XPath xdXDocument:GetDOM("Config")/my:QuizForm/my:Modules/my:Module/my:ModuleName[../my:ModuleNo = current()/../my:ModuleNo]

    This means that the control will show the value of the Config ModuleName field  filtered so that the Config ModuleNo is the same as the main ModuleNo which is being set by the incrementing Module row count we've set earlier. Everything inside the square braces ( [ ] ) is an XPath filter. Basically, we are telling InfoPath we'd like the ModuleName from the Config and then providing further information to make sure the correct module name is selected.

    14.    Click OK twice to close the dialogs.

    Next, we will change the question texts' default values to pull from the configuration file using the same technique.

    15.    Double-click on the QuestionText field of the main data source to see its properties, you will see the the default value you've manually added from Lab 1.

    16.    Click on the fx button and change it to point to the secondary data source:

    a.   Click Insert Field or Group...

    b.   Switch to the Config (Secondary) data source and select QuestionText.

    c.   Click Filter Data... > Add.

    d.   Select QuestionNo in the first drop-down.

    e.   Choose Select a field or group... in the third drop-down.

    f.   Switch to the Main data source and select QuestionNo.

    g.   Click OK once.

    17.    We will add another filter condition in order to get only the question set for the corresponding module.

    a.   Back in the Specify Filter Conditions dialog, click on the button labeled And.

    b.   Choose Select a field or group... in the first drop-down.

    c.   Select the ModuleNo field from the Config data source and click OK.

    d.   Choose Select a field or group... in the third drop-down.

    e.   Switch to the Main data source and select ModuleNo.

    f.   Click OK four times and then check the Edit XPath (advanced) box to see the formula

    The formula used is: xdXDocument:GetDOM("Config")/my:QuizForm/my:Modules/my:Module/my:Question/my:QuestionText[../my:QuestionNo = current()/../my:QuestionNo and ../../my:ModuleNo = current()/../../my:ModuleNo]

    Here again, we are telling InfoPath we'd like the QuestionText from the Config and then added filters to make sure the correct question for the corresponding module is selected.

    Add More Default Rows

    At this point, you would want to add a couple more default rows for your repeating groups so that you'll have placeholders for new items that are added via the Config.xml.

    18.    Go to the Data tab > Default Values.

    19.     Expand Modules >  Module (last repeating group), and then select the last Question repeating node.

    20.    Click on the down-arrow key next to node, and then select Add another Question below.

    21.    Keep adding until you have about 10 repeating Question nodes. Note that if you ever exceed this, i.e. you modify Config.xml to add more than 10 questions for a module - you will need to do this step again and add placeholders.

    22.    When done, select the last Module repeating node and also add more until you have about 5.

    23.    Click OK when done.

    When you preview your form template, you will see almost no difference to the template you've created for Lab 1 - only now, we are not using default data; instead, our data is retrieved from a secondary XML data source.
  • Free Training: Data-Driven Design - Using Default Data (Lab 1)

    In this lab, you will be provided with a starter form template that has a simple pre-designed layout, the schema, and an email submit data connection so that you won't have to create them from a blank template.

    Take time to familiarize yourself with the form schema by looking at the fields in the main data source as well as how the controls are laid out on the design canvas.

    Add Default Values to the List of Modules

    Notice the Module dropdown - this lists all the modules with default values which we will configure in this lab. If you right-click on the SelectedModule dropdown list box (under the heading Select a Module) and select to show its properties, you will see that it gets choices from the Module repeating group - from within the main data source.

    In order to provide options for this dropdown, we need to add default values for the ModuleNo and ModuleName fields.

    1.       Go to the Data tab > Default Values.

    2.       Expand Modules > Module (first repeating group), select ModuleNo and then enter the default value: 1.

    3.       Select ModuleName and then enter the default value: Module 1 - Getting Started.

    4.       For the second Module repeating group, add the following default values:

    • ModuleNo: 2
    • ModuleName: Module 2 - Schemas

    You may also add default nodes manually. For this lab, we will add a third Module.

    5.       Click on the down-arrow key next to the second Module repeating node, and then select Add another Module below.

    This will add another set of Module and Questions with the last-entered values copied over by default.

    6.       Replace the default values with the following:

    • ModuleNo: 3
    • ModuleName: Module 3 - SharePoint Integration

    7.       Click OK when done.

    When you preview your form template, you should see the Module dropdown list box populate with the default values you've added:

    Add Default Values to the List of Questions

    We will also ‘hardcode' values for the QuestionNo and the QuestionText fields, hence giving them their default values.

    8.       Close Preview and then go back to the Data tab > Default Values.

    9.       Expand Modules > Module > Question.

    10.    Each module will have a list of three questions. Add the following default values for the QuestionNo and the QuestionText for each corresponding module (to save time, copy from this document and paste into the Default Value box of the respective field).

    ModuleName
    QuestionNo
    QuestionText
    Module 1
    1
    Guidance text helps users fill out forms. List three ways to add guidance text to your form.

    2
    InfoPath Designer starts with the main data source. When building a form from the ground up (blank), why is it important to identify your secondary data sources up front?

    3
    How do you uniquely name an email when you submit the form?
    Module 2 1
    What are the pros/cons of using an XML resource in the XSN vs. XML from a network share?

    2
    How do you change the default value for choice group?

    3
    How do you change default value for choice group?
    Module 3 1
    What's the difference between Save and Submit?

    2
    Why does Microsoft promote SharePoint workflows? Why are the benefits?

    3
    List 3 things that browser-based forms can't do. Why not?

    Let's also add two more default Question nodes for Module 3; but this time, there will be no default values for the questions, i.e. blank - we will conditionally hide blank questions later.

    11.    Click on the down-arrow key next to the last Question repeating node, and then select Add another Question below twice.

    12.    Delete the copied-over values in the QuestionNo and QuestionText fields for both nodes.

    13.    Click OK when done.

    Conditionally Hide Questions

    If you preview your form template at this point, you will see all the default questions you've just added. We don't actually want to show them all. Instead, we'd want to display only those questions corresponding to the selected module.

    14.    In the Fields taskpane, select the Module repeating node.

    15.    From the Home tab > Rules section, click Manage Rules to display the Rules taskpane.

    16.    Add a conditional formatting that hides questions that don't belong to the selected module.

    a.   Click New > Formatting.

    b.   Name your condition something like "Only show questions for the selected module".

    c.   Click ‘None' under Condition to display the dialog where you can add your conditions

    d.   In the Condition dialog, leave the first dropdown pointing to the ModuleNo field but change the comparison (second dropdown) to ‘is not equal to'.

    e.   On the third dropdown, choose Select a field or group..., choose the SelectedModule field of the Main data source.

    f.   Click OK twice and then check the box ‘Hide this control'.

    Your conditional formatting should look similar to this:

    We also need to conditionally hide questions that have no default values, i.e. those that are blank.

    17.       In the Fields taskpane, select the Question repeating node.

    18.       Add your conditional formatting:

    a.   In the Rules taskpane, click New > Formatting.

    b.   Name your condition something like "Hide blank questions".

    c.   Click ‘None' under Condition to display the dialog where you can add your conditions

    d.   In the Condition dialog, leave the first dropdown pointing to the QuestionNo field but change the second dropdown to ‘is blank'.

    e.   Click on the button labeled And and then change the operator to or.

    f.   Select QuestionText in the first dropdown and then change the second dropdown to ‘is blank'.

    g.   Click OK and then check the box ‘Hide this control'.

    Your conditional formatting should look similar to this:

    Once again, preview your form template. After you select a module, you should be able to see the default questions for that module. If you select Module 3 - SharePoint Integration, you should still see only 3 sets of questions - others that have blank values are hidden.

  • qRules and SharePoint-related Commands

    Scenario


    Have you ever wanted to be able to add InfoPath form data to SharePoint list? Sure, promoted properties in your form library are fine – for one layer deep data. Real world data often has one to many relationships, however (think Customers and Orders, or Orders and Products), and SharePoint and InfoPath like to handle that by mushing all your nicely organized information into semi-colon delimited lists. Not so pretty, not so useful.


    Perhaps you also have attachments in your form that you’d like added to existing list items, speeding up your form by keeping it sleek and having the attachments out of the XML where they are easier to find. InfoPath and SharePoint won’t do this for you, but qRules can.


    What about updating your list items in your InfoPath form if they were changed after the form was submitted and items were submitted to your list? Wouldn’t that be great? You could have the best of both worlds.


    Value Proposition


    You could write code to submit your list items. You could even add a secondary data connection to your form to help you generate CAML and submit repeating items one at a time. Of course, that means you have to write and maintain code, or ever worse, rely on your users to push the “Submit” button on each item. They’d never forget to do that, right?


    With qRules, you can easily add the ability to submit information from your form to a list or to two lists. You can map the fields you want to submit. You can use additional commands to add any attachments to the list items. And, if you want, qRules will even refresh the list items in the form with the latest from the list. qRules consists of modular commands that you can leverage together to create powerful forms with all the features that custom code provides and none of the maintenance that custom code carries along with it.


    Requirements


    • qRules v2.3
    • Access to the SharePoint List you wish to submit items to
    • InfoPath To SharePoint List tool for mapping (this tool is provided with qRules)
    • Note: This document was written for SharePoint 2007. If you run into questions when trying these steps for SharePoint 2010, please contact support at qdabra dot com.

    Click on this link to download the documentation that covers the following qRules commands:


    • SubmitToSharePointList
    • RefreshSharePointListItems
    • AttachToSharePointList
    • Extra: SharePoint DeleteAttachment operation

More Posts Next page »
Copyright © 2003-2017 Qdabra Software. All rights reserved.
View our Terms of Use.