Category Archives: InfoPath 2010

How to hide a group of fields in a SharePoint list using InfoPath 2010


You may also be interested in: fpweb.net


 

Editor’s note: Follow contributor Abhisarika Singh @Abhisarika.

I’ve found a really easy way to make collapsible/hidden group of fields in a SharePoint list form using InfoPath 2010. The important thing is we can apply this in an existing list and can modify the form. Below are the steps we can use to make a hidden group of fields:

  1. Open the list in InfoPath 2010 and select Section from the menu bar:
  2.  2013-10-08-HideGroupFields-01.png

  3. Select the section and insert a new table in that section.
  4. 2013-10-08-HideGroupFields-02.png

  5. Then insert the fields in the table. As I mentioned, my list is already present and I like to hide the fields based on the conditions. So I just drag the fields from the field column to table rows and show them in a table. This table must be inside the section.
  6. 2013-10-08-HideGroupFields-03.png

    2013-10-08-HideGroupFields-04.png

  7. Once we complete the table with the fields we would like to hide, based on our condition, we go to “section”. This is the important thing we need to do for hiding or showing our fields based on our condition.
  8. Select the “section” and go to “Manage Rule”. Insert a new rule having the condition as per our requirement. In this example I’ve put a condition that if field “Request type= Deletion” then this employee’s details table will be hidden through the “formatting” rule or not displayed.

    2013-10-08-HideGroupFields-05.png

    Then set the condition I mentioned above:

    2013-10-08-HideGroupFields-06.png

    Go to formatting rule and select “hide this control”:

    2013-10-08-HideGroupFields-07.png

That’s it. Now you can see your form as per the condition you set.

2013-10-08-HideGroupFields-08.png

SharePoint - InfoPath 2010: Form Library Modal Popup


You may also be interested in: SharePoint-based solutions by B&R Business Solutions


 

Editor’s note: Contributor Chris Grist is a SharePoint Architect at Beach Energy. Follow him @gristdog

In the last couple of weeks I have worked on several InfoPath projects which are using form library’s to save the completed form. However I did not like the way the user was navigated away from the site to enter a new form, several of these forms I wanted to be rapidly completed and therefore I started to look at a different way to open the forms.

Of course in SharePoint 2010 we have the modal popup dialog, and after looking at a list form that had been customised with InfoPath, it appeared that it was possible to have an InfoPath form load inside a modal popup.

The rest of this post details how you would achieve this.

The first step is to get your form ready and published, once this is complete head over to your form library and click add a new item.

Once the form has loaded copy the URL:

2012-07-30-FormLibModalPopup-01.png

You will end up with something that looks like:


<a href="https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&DefaultItemOpen=1">https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&DefaultItemOpen=1</a>

If you were to create a normal hyperlink to the above address, the chances are it will try and open in InfoPath client, so therefore we need to remind it to open in the browser using the syntax OpenIn=Browser. Therefore the link we now have saved looks like the following:


<a href="https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&OpenIn=Browser&DefaultItemOpen=1">https://sharepoint.com/_layouts/FormServer.aspx?XsnLocation=https://sharepoint.com/SharePointSaturday/Forms/template.xsn&SaveLocation=https://sharepoint.com/SharePointSaturday&ClientInstalled=true&Source=https://sharepoint.com/SharePointSaturday/Forms/AllItems.aspx&OpenIn=Browser&DefaultItemOpen=1</a>

To open a form inside a modal popup, SharePoint 2010 uses JavaScript which is linked to in the following format:


<a onclick="javascript:NewItem2(event, "INSERLINKHERE");javascript:return false;" target="_self">Open Form</a>

Insert your link in between the quotes where it says INSERTLINKHERE. Then insert the hyperlink on to a page, I had trouble inserting directly on to a page but inside the a content editor web part works just fine.

2012-07-30-FormLibModalPopup-02.png

Now when we click the link you should receive a modal pop-up and not be redirected to a separate page.

2012-07-30-FormLibModalPopup-03.png

If you don’t need the ribbon controls it can look even slicker:

2012-07-30-FormLibModalPopup-04.png

InfoPath 2010: Display Version Number on a Form


You may also be interested in: O’Reilly - SharePoint 2010 at Work


 

Editor’s note: Contributor Chris Grist is a SharePoint Architect at Beach Energy. Follow him @gristdog

Each time you save a form template with InfoPath, there is a version number that is incremented, shown below:

2012-07-19-VersionNumber-01.png

I find it useful to know which versions are being used, especially if I have to troubleshoot a reported issue.

Thankfully it’s quite easy to display this version number on the form its self. To achieve this just add a calculated field to the form:

2012-07-19-VersionNumber-02.png

Then paste in the following to the XPath text field:



2012-07-19-VersionNumber-03.png

Now when you preview the form you will see the version number:

2012-07-19-VersionNumber-04.png

SharePoint - InfoPath 2010: Splash of Metro


You may also be interested in: SharePoint-based solutions by B&R Business Solutions


 

Editor’s note: Contributor Chris Grist is a SharePoint Architect at Beach Energy. Follow him @gristdog

A few weeks ago Windows 8 Release Preview shipped. I have been looking at Windows 8 from a far to date, but I attended one of the free developer camps hosted by Microsoft which helped understand how to actually use Windows 8. After the event I loaded up my laptop with the OS and am slowly getting used to it. I decided to do some InfoPath design based on metro principals and make it similar to Windows 8.

Looking at the form on Windows 8 does make it look a bit nicer, but I tried it out on a Server 08 box and it wasn’t too bad.

Here’s a screenshot of what the form looks like.

2012-06-14-InfoPath2010-01.png

I’m using the recommended font sizes from Microsoft for the typography (42->24->11->9), and Sergoe UI for the type face. One bit of trouble I ran in to is that for some controls InfoPath doesn’t let you have a border, therefore I had to use a wrapper table with a border set and remove all the margins and padding.

Once I had created the top section of the form, I started out on the app bar at the bottom. Keeping in with the Windows 8 design principal, the contextual icons are on the right and the global icons are on the left. Here are a couple of examples from different views.

View 2 (presumably the last view of the form and therefore has the save/submit button).

2012-06-14-InfoPath2010-02.png

Help View (It may be worthwhile having a help view for each form page, this way the back button would go back to the correct view, currently its going back to the start of the form).

2012-06-14-InfoPath2010-03.png

Here is the help view in full. Just with some filler text for now.

2012-06-14-InfoPath2010-04.png

To give you a jump start I have uploaded my xsn to download. As for the icons for the app bar, I found a useful set located here: http://www.iconsforwindows8.com/free-windows-metro-icons/index.htm

I expect when the Beta of Office 15 hits hopefully containing InfoPath 15, it may be easier to crea<p>te metro inspired forms.

Metro Form (3)

Connecting a WCF Service to an InfoPath Form


You may also be interested in: SharePoint Apps by Cybozu


 

Editor’s note: Contributor Kathryn Bartlett is a member of the Gig Werks team.

When you are connecting a WCF Service to an InfoPath form and happen to come across the following error:

2012-04-30-WCFService-01.png

To resolve this, you need to do the following two steps:

1. Enable cross-domain access for InfoPath Forms

2. Store the data connection in a UDC file on your SharePoint site.

Enabling Cross-Domain Access

Go to “General Application Settings” in Central Administration and click on “Configure InfoPath Forms Services”.

2012-04-30-WCFService-02.png

Check “Allow cross-domain data access for user form templates that use connection settings in a data connection file”

2012-04-30-WCFService-03.png

Hit OK.

Storing the Data Connection in a UDC File

First, create a Data Connection Library on your SharePoint site.

Copy the URL of this library up to, but not including, the /Forms/AllItems.aspx.

In Infopath, go to your Data Connections, and select your WCF Data Connection. Click “Convert to Connection File…”

2012-04-30-WCFService-04.png

Enter the URL to your data connection library and append ‘/’ followed by a file name of your choice with extension udcx. Leave the Connection link type as the default and hit OK.

2012-04-30-WCFService-05.png

Now go to your data connection library, select the “Approve/Reject” option from the dropdown of your file, and select “Approve”.

Publish your form and it should open with no problem.

This article was originally posted on Gig Werks blog The SharePoint Blog.net.

SharePoint 2010 - How to Change a Workflow Task Form with InfoPath


You may also be interested in: SharePoint Apps by Cybozu


 

Editor’s note: Contributor Jasper Oosterveld is a SharePoint Consultant at Wortell. Follow him @SharePTJasper

Introduction

In one of my previous articles I described how you can change the e-mail messages sent during workflow activities. I mentioned that it is also possible to change the look and feel of the workflow task form:

In this article I will explain how easy it is to create your own custom task form

Open SharePoint Designer and find your workflow settings page. At the right bottom of the screen you will find Forms:

There are two forms, one for the Initiation (optional) and Task. We are going to change this one so click Approval.xsn to open it. The task form will open in InfoPath:

This is pretty awesome because we can use features from InfoPath such as rules and controls! Let’s start!

Look and feel

You can change the look and feel of the form by selecting a theme. Go to Page Design and select the theme you prefer. For example:

It is as easy as that! Now you can also add a title and a company logo to personalize the form even further. Click on Insert and Picture to add a logo:

You can resize a couple of fields, just look at Due Date, this field is too stretched out. It would be nice if the Comments field could be mandatory. Unfortunately you can’t select this option in the properties of the field.

This would be a good time to start using the rules feature of InfoPath! This is a slight workaround but it does the trick. You can disable the buttons if the comments field is empty! Click Manage Rules and then perform the following actions:

  • Select the button
  • Click on New and Formatting
  • Configure the following condition:
    • Comments is blank
  • Select Disable this control

Preview the form to see what happens:

The Approve button is disabled because the Comments field is empty! You can copy the rule and apply it to every button. To make life a bit easier for the approvers change the text under the comments field so now the field is mandatory.You need to save the form before you can republish it. Let’s start the workflow and open the task form:

This is pretty cool right? Just remember that you only changed one view! There are couple more:

So don’t forget to change these as well. I hope you enjoyed this article.

SharePoint 2010: Reset Customized List Forms from InfoPath Back to Default


You may also be interested in: SharePoint Search and List Previews by Vizit


 

Editor’s note: Contributor Adam Preston is a Senior SharePoint Consultant for TCSC. Follow him @_apreston

If you have a SharePoint 2010 List Form that you have customized using InfoPath 2010 and for whatever reason need to revert back to the default forms, then follow this simple process below:

Customized form to replace

2012-05-28-RestCustomizedList-01.png

Located the list in question and use the ribbon to select List > List Settings

2012-05-28-RestCustomizedList-02.png

On the List Settings page, select “Form settings” under “General Settings“.

2012-05-28-RestCustomizedList-03.png

Change the Form Option from “Modify the existing InfoPath form” to “Use the default SharePoint form“. If you want to completely remove the form, also check “Delete the InfoPath Form from the server“.

2012-05-28-RestCustomizedList-04.png

The list form has now been reset back to the default.

2012-05-28-RestCustomizedList-05.png

SharePoint: How to Create Multiple Cascade Drop Downs Using InfoPath 2010


You may also be interested in: the Outlook sidebar by harmon.ie


 

Editor’s note: Contributor Usman Ahmed is Senior Project Officer for Chester University.

Today, I will walk you through the steps to create an AV Asset form using InfoPath 2010 with multiple cascading drop downs. The form will contain the following information:

2012-05-18-CascadeDropDown-01.png
InfoPath 2010 AV Asset Form

In this AV form Equipment Type, Manufacturer and Model number are interdependent lists. If a user picks equipment type from equipment combo box, the list of manufacturers’ combo box should only show manufacturers which are related to this equipment type.

For Example when we the select equipment type Analogue Project, It will only show the manufacturers Kodak, Elmo, Simda and Sennhesiter.

2012-05-18-CascadeDropDown-02.png
SharePoint 2010 Equipment List

At next level when users select Manufacturer name then the Model list will show only the model number related to the selected Manufacturer and Equipment type.

For Example, a user selects Equipment Type=” Analogue Project” and Manufacturer = “Kodak” then only the model number, related to this equipment type and Manufacturer, will appear in Model list.

2012-05-18-CascadeDropDown-03.png
SharePoint 2010 Model List

Let’s start to implement our scenario.

Step 1:

Create custom Equipment Type List in SharePoint. This will look like the following list.

2012-05-18-CascadeDropDown-04.png
SharePoint Equipment List

Step 2:

Create a custom Manufacturer List in SharePoint. In this list we will use an equipment list as a look up field. When a user enters a manufacturer name, he must pick an equipment type. Basically in this list we are storing the relationship between manufacturer and equipment type.

2012-05-18-CascadeDropDown-05.png
SharePoint Manufacturer list

Our Manufacturer list will look like this.

2012-05-18-CascadeDropDown-06.png
Manufacturer list view

Step 3:

Create a custom Model List in SharePoint. This is where we will store model numbers against equipment type and manufacturer name.

In this list there are two lookup fields, one for equipment type and another for manufacturer’s name. We have also implemented a cascading drop down condition based on equipment type. E.g. when a user picks equipment type, the manufacturer list will be automatically filtered based on selected equipment type.

2012-05-18-CascadeDropDown-07.png
SharePoint 2010 Model list

To implement cascading, select list and click on List Tools in the bread crumb menu then click on the Customize Form with InfoPath icon button.

2012-05-18-CascadeDropDown-08.png
SP 2010 list bread crumb

In InfoPath the form will look like this: When we open the form in InfoPath there is already a default data connection created. But we need to create an extra secondary data connection for the manufacturer combo box, so we can bring in the equipment type field which we need to apply a filter to.

2012-05-18-CascadeDropDown-09.png
SP 2010 Model list design

Step 3.1

Create a secondary data connection. Click on Data Menu, Data Connections and Add Data Connection to receive data from a SharePoint list or library then chose the manufacturer list which we created earlier and select the following fields.

2012-05-18-CascadeDropDown-10.png
InfoPath data connection wizard

Finish and close this wizard.

Step 3.2

Click on Drop Down List Properties of the Manufacturer combo box and change the data source to the newly created data connection.

2012-05-18-CascadeDropDown-11.png
InfoPath combo box properties

Click on select X Path button next to the entries box.

2012-05-18-CascadeDropDown-12.png
X Path entries

Click on the Filter Data button and then on the Add button to specify filter conditions. The hierarchy of opened windows will look like this.

2012-05-18-CascadeDropDown-13.gif
SP 2010 Drop Down List Box filters

In the Specify Filter Condition form we are specifying conditions based on the equipment type field which is in the Manufacturer DS (which is our secondary data source that we created earlier) is equal to the equipment type field in our main data connection. This is the selected equipment type combo box’s value on this form:

2012-05-18-CascadeDropDown-14.gif
InfoPath list design

Save your changes and publish your changes to SharePoint. Now you can see that the cascade drop down condition is implemented on the Model list.

2012-05-18-CascadeDropDown-14.png
Model list after publish

Step 4:

Create an AV Asset form in InfoPath 2010.

2012-05-18-CascadeDropDown-15.png
InfoPath Asset Form

Here we are going to implement a cascading condition on the Manufacturer and Model combo box, whose values will depend on the equipment type combo box.

Step 4.1

We need to create three data connections to receive data from our SharePoint lists. This data connection will receive data from

  1. Equipment Type List (This will be the data source of the equipment data type combo box)
  2. Manufacturer List (This will be the data source of the Manufacturer combo box)
  3. Model List (This will be the data source of the Model combo box)

Our three data connections will look like this:

2012-05-18-CascadeDropDown-16.png
Data connections

Step 4.2

Change the data source of the equipment type Combo Box:

Right click on the equipment type combo box and click on Combo Box Properties.

2012-05-18-CascadeDropDown-17.png
Equipment Combo Box Properties

The Combo Box Properties windows will open, from the list box choices section we need to select get choices from an external data source.

2012-05-18-CascadeDropDown-18.gif
Equipment Data Connection

The Data Source Combo Box will be enabled. From the drop down combo box select the data connection which we created for equipment type SharePoint list.

Step 4.3

Using steps mentioned in step 4.2 change the data source for the Manufacturer combo box

Step 4.4

Using steps mentioned in step 4.2 change the data source for the Model combo box.

Now click on the preview button and verify all three combo boxes are displaying the right values from your SharePoint list.

2012-05-18-CascadeDropDown-19.png
Combo box with filters

Step 5

Implement cascading filters, so when we select equipment type we can see all relevant manufacturers of select equipment types and when values of equipment type and manufacturer are selected, the model combo box should show only relevant model numbers.

Step 5.1

Click on the properties of the Manufacturer combo box and click on select X Path button next to the entries box.

2012-05-18-CascadeDropDown-20.png
X Path entries

Click on the filter data button and click on Add button to specify filter conditions. The hierarchy of opened windows will look like this.

2012-05-18-CascadeDropDown-21.png
Combo Manufacturer Filter

In the filter data box we have mentioned a filter condition. Select only those records where equipment type in the manufacturer data source is equal to the equipment type selected from the equipment combo box in our form.

Now when we select the equipment type value from the combo box, it will only show relevant manufacturer names in the manufacturer combo box.

2012-05-18-CascadeDropDown-22.png
Equipment values

Step 5.2

To implement a cascading filter condition on the Model combo box we need to follow the same steps mentioned in step 5.1, apart from filter condition. In this case our filter condition will be like this:

2012-05-18-CascadeDropDown-23.png
Specify filter conditions

Here we are selecting all model numbers from the model source data connection where equipment type in the model data source is equal to the equipment type selected on the form and Manufacturer name in the model data source connection is equal to manufacturer name selected on the form.

Note: Model data source is a SharePoint List which contains all the information about models, equipment types and manufacturers.

2012-05-18-CascadeDropDown-24.png
SharePoint 2010 Model List

After applying above mentioned filter conditions, the Model combo box will show only relevant model number related to equipment type and manufacturer.

 2012-05-18-CascadeDropDown-25.png
Final list

Step 6:

Save changes and publish form to the SharePoint document library.

2012-05-18-CascadeDropDown-26.png

InfoPath Currency Converter - Part 2


You may also be interested in: the Outlook sidebar by harmon.ie


 

Editor’s note: Contributor Chris Grist is a Senior Technical Consultant for Loftus IT. Follow him @gristdog

In Part 1, we created a new form that has the components required for us to create a currency conversion component. We have a working calculation working from a button located on the form, however this is using a static rate.

At the end of Part 1 we ended up with a form that looked a little like this:

We now are going to continue and achieve the following:

  • Connect to a Currency Conversion Web Service.
  • Provide drop down lists of available currencies.
  • Set the Exchange Rate relevant to our selected values.

After a bit of hunting I found a web service that would suit the needs of this project. It can be accessed using the following URL: http://www.webservicex.net/CurrencyConvertor.asmx

From the description this does exactly what we need it to. Adding this in to InfoPath couldn’t be simpler. But as this web service is out on the web we need to change our form in to full trust mode. To do this click File -> Form Options and from the left select Security and Trust, from here you can uncheck Automatically determine security level and select Full Trust.

Now we are ready to add our web service. On the Fields pane click Manage Data Connections. Click on Add and then follow the wizard as illustrated.

Leave the defaults and click Next.

Leave SOAP Web Service selected and click Next.

Enter the URL of the web service into the location box and click Next.

The web service, has only a single method ConversionRate select it and click Next.

On this screen you are able to set default values, notice that when you do you get a great drop down list of valid items that will come in handy later. I’m from Australia so have set both values to AUD to begin with. Click Next, Next and finally Finish.

You have now successfully added the web service in to InfoPath. The next step will be to add those useful drop downs we just saw in to the form for the end user to utilise in selecting valid currencies.

In the Fields pane select the drop down that currently has Main selected; select the secondary data source of ConversionRate. Expand the structure, and inside queryFields you can see the two values we set earlier, FromCurrency and ToCurrency.

Simply drag and drop these on to the form, a menu will appear and you will want to select drop down box as the type of field to utilise. If you preview the form now your drop down lists should be functional.

Brilliant, we have all the values the web service support so we should be safe from errors. Next open the properties of the exchangeRate field, set the default value to the ConversionRateResult as shown below. Ensure that Refresh value when formula is recalculated is checked.

Finally we just need to edit the rules on our Convert button, select the Convert button and then select Manage Rules select the rule we created earlier, most likely with its default name Rule 1. Add a new action of type Query for Data. We only have one web service currently so by default the data connection selected is ConversionRate click OK. We need to ensure that we query for data before setting the outputAmount there for highlight the action that we just added and select Move Up.

You should end up with the two actions like this.

That’s It! Preview your form, enter a value and select your from and to currency and hit the convert button. We now have the value coming back that we expect.

To recap, we created a new InfoPath form, laid out some controls with a couple of rules, connected a conversion rate web service and hooked it up all together to make a InfoPath currency conversion form. These components can now be used various ways in many other forms that would require currency conversion. If you got stuck I have provided the .xsn file below for you to use.

InfoPath Currency Conversion: InfoPath Currency Conversion (2)

InfoPath Currency Converter - Part 1


You may also be interested in: Build a Scalable Architecture by KnowledgeLake


 

Editor’s note: Contributor Chris Grist is a Senior Technical Consultant for Loftus IT. Follow him @gristdog

I am lucky enough to be attending #ISCLondon, and what does this have to do with an InfoPath currency converter article I hear you ask. I live in Australia so when I return to work I will have a few receipts to log as part of a expense claim process. The receipts will obviously be in GBP and I will get paid in AUD.

It just so happened that the Expense Claim form is one that I have not yet converted internally to SharePoint, so this got me thinking about starting it and one of the key features it’s going to need to be successfully launched in the company. Currency Conversion.

I took a quick trip over to XE.com and had a look at how their currency converter worked. The form for currency conversion basically consists of the following components:

  • An input value
  • A from currency
  • A to currency
  • A submit button

This can be seen in the following screenshot:

The end result is the total amount of the “to currency” that will be gained by a currency conversion and the rate that was used to make the calculation. The calculation is obviously quite simple and something InfoPath can handle without much sweat:

From Currency X Conversion Rate = To Currency

In Part 1 of this two part series, i will first demonstrate how we build the required form in InfoPath. I will use a static rate of exchange to prove the calculations embedded in the form are functioning correctly. In Part 2 i will demonstrate how we can use a Web Service to provide the rate for the specific currencies selected.

  1. Create a new Blank Form in InfoPath 2010.
  2. Add the following controls to the form:
    • A text field called inputAmount, configure this as a Decimal (double).
    • A text field called outputAmount, configure this as a Decimal (double).
    • A button called convert

You should end up with something similar to this:

In the fields pane right click myFields and select Add, call this new field exchangeRate. For now give this a default value of 1.5.

Select the convert button, and from the ribbon select Manage Rules. Click Add and then select set a fields value. Set the outputAmount field to the value of inputAmount x Rate.

Preview the form and you should now have a functioning multiplication calculation, that is updated each time convert is pressed.

Right click the outputAmount text field select Change Control and choose Calculated Field. This is so the user cannot edit the amount. We don’t want them tampering with the amount of money they are going to get paid!

Finally select the inputAmount text field, and add an Action rule, the rule is to set the outputAmount to be blank, so that the values are always correct.

To recap, we have created a new form that has the components required for us to create a currency conversion component. We have a working calculation working from a button located on the form; however this is using a static rate.

Before Part 2, give your form a bit of jazzing up and you’ll end up with something like this:

In Part 2, I will show you how to use a web service to populate the correct rate, based on user selections in the drop down menus.