Video: SharePoint and Infopath 2010 - Conditionally Hide Form Fields

Considering my recent Webinar venture I thought it's be fun to try out video as a blogging medium. I've remade my previous guidance on conditionally hiding SharePoint Form Fields with InfoPath 2010 as a video. The results of my work, and a transcript of the video are below. Might be best to view this video in Full Screen. As this is a first attempt at video please let me know of any problems you encounter.

Here is a transcript of the video;

OK so welcome to todays tutorial on using InfoPath Forms with SharePoint 2010

Today we'll be looking at how we conditionally hide form fields using a very simple concept in InfoPath known as Rules

On the screen now you will see a standard SharePoint 2010 Task List

however I have changed this Task List to add two extra columns

which you will see here. We have the Special Conditions Applied column

which is a Yes/No tickbox, and we have the Special Conditions Details

which is a Multi-line text field. The idea is that with my Task I may specify extra conditions

which people need to be aware of.

When Users create new Tasks in the List, I want to hide the Special Conditions Details field

when the Special Conditions Applied tickbox has not been selected

Using InfoPath 2010 with SharePoint I can do this very easily indeed.

So, how do I begin?

First of all I need to go to the Lists Tab of The Ribbon


I click the Customize Form button and this will open Infopath 2010

InfoPath 2010 opens and shows me a representation of the List Form for my Task List

You can see here at the bottom my two extra fields, Special Conditions Applied, and Special Conditions Details

To conditionally hide Special Conditions Details I select the field

then, Manage Rules and I create a new Rule here by clicking New. This is going to be a Formatting Rule as it's hiding something.

I give my Rule a good name so I know what it is when maintaining this Form in future.

So the main thing I want to do is hide this field control, so I tick the box here

When do I want to hide it? Well, I need to set a Condition. There isn't a Condition yet but I click None here under Condition I can set a new one.

My condition is that when Special Conditions Applied is Equal to FALSE, i.e. the tickbox is not ticked we want to hide this field.

Only when there is a Special Condition and we've ticked this field do we want the Textbox to show up.

I OK that, and I now have my Rule.

That's all I need to do.

To Publish my changes I just click the Quick Publish button at the top left of the screen.

Then I get a message saying the form was successfully published.

Going back to my Task List...

if I add a new item

I should now see my new InfoPath Form, not a standard SharePoint Form.

Here we see the new form which I created in InfoPath. As you can see it looks a little different.

The thing that is interesting here is that there is no field where the Special Conditions Details Text Box should be.

Unless I tick the Special Conditions Applied box

and then I'm able to type here.

Unticking the box will also hide it again.

That concludes todays video.

Disclaimer: The software, source code and guidance on this website is provided "AS IS"
with no warranties of any kind. The entire risk arising out of the use or
performance of the software and source code is with you.

Any views expressed in this blog are those of the individual and may not necessarily reflect the views of any organization the individual may be affiliated with.