Home > work > How to hide fields for new items using InfoPath

How to hide fields for new items using InfoPath

 

A client had a fairly simple request to hide some fields when a new SharePoint list item is created but have these fields shown once the item has been created and people edit the form. The short version is that you can use the inbuilt ID field to see if an item is new or not. If the ID field is blank then it is a new form.

 

Here are the steps required so that you can hide fields when an item is being created. Make sure not to hide any required fields or the form cannot be saved.

These steps require InfoPath 2010 client to be installed

1. Navigate to the list

a. I have created a very simple list where users will ask a question. The goal is only to allow users to fill out the title field when an item is created

 

2. From the ribbon select the Customize Form option

a. clip_image001

b. If this option is missing then following feature is probably not activated

c. clip_image002

3. A form will now have opened in InfoPath 2010

a. clip_image003

4. Each field can be hidden manually or all of the fields you want to hide can be added to a new section and then you just hide the section.

a. Select the Section control and add to the bottom of the form

b. Copy or cut the required rows or fields from the table into the section. It will look similar to the following screen shot

c. clip_image004

5. Now we need to add a rule to the section to hide it.

a. Select the Manage Rules option from the ribbon

b. clip_image005

c. Highlight the section (Click on it)

d. clip_image006

e. From the Rules menu on the left hand side select New and then Formatting.

i. Change the name to be Hide Section

ii. Click on the None under condition and change it to the following

iii. clip_image007

iv. Now select the Hide this control option

v. The whole rule should look like

vi. clip_image008

6. Using the publish button in the very top left of InfoPath publish you changes back to the server. clip_image009

a. You should receive an OK message once this is complete

7. Now navigate to the list and test to see if it has worked

Here is the new form

clip_image010

This is what the form looks like when an existing item is edited

clip_image011

This is just a very basic example. The overall style of the form can be changed using the formatting option within InfoPath.

Rule can also be applied directly to some fields so they do not have to be moved into a section if you do not want to. The attachment control must be added to a section as rules cannot be applied against this control directly.

Advertisements
Categories: work Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: