Add data to shapes

A Microsoft Office Visio drawing can be far more than a picture ― it can also be a valuable way to organize your data and retrieve your data in a report.

This article discusses the best ways to manually add data to selected shapes, how to create a reusable set of data that you can apply to multiple shapes in your drawing, and how to add data to a master shape.

Note: The following procedures apply to both Microsoft Office Visio Professional 2007 and Microsoft Office Visio Standard 2007. If you have Visio Professional, you can automatically import data, add data to shapes, and show data on shapes with data graphics. To find out which edition of Visio you have, on the Help menu, click About Microsoft Office Visio.

What do you want to do?

Add data to selected shapes

To add data to shapes that are already in your drawing, first you add the data fields to your shapes and then you add the values.

Tip: The following procedure is the simplest way to add data to shapes. However, if you want to add the same data to multiple shapes, consider one of the alternatives described in the other sections of this article.

What is the difference between a data field and a value?

A data field is a labeled cell that can hold values.

A value is the text or numbers in the cells of a database table, worksheet, or in this case, a shape.

Here is an example that shows the Shape Data window with the fields and values for a Decision shape from the Basic Flowchart stencil. In this case, the fields are Hourly rate, Network access required, and Duration of contract, and the values are $49.00, Yes, and 3 weeks.

Add data fields to selected shapes

Select the shape or shapes that you want to add data to.

Right-click the selection, point to Data on the shortcut menu, and then click Shape Data.

When you see a message that asks if you want to define the data now, click Yes.

Note: If the shape already contains data fields, you will not see this message.

In the Define Shape Data dialog box, type a label for the field.

To create another field, click New and repeat step 4.

After all of your data fields are defined, click OK.

The Shape Data dialog box appears, showing your fields.

Add values to your data fields

On the View menu, click Shape Data Window.

Select each shape one at a time, and type the values into the data fields in the Shape Data window.

Note: The contents of the Shape Data Window shows the data for the selected shape only.

Add data fields to a master shape

If you want to add the same set of shape data every time you use a particular shape, you can save time by adding the data fields to a copy of the master of that shape. For example, you can add data fields such as name and employee number to the master of a person shape.

Right-click the master that you want to add shape data to, point to Add to My Shapes, and then click Add to New Stencil.

Note: If you already have a custom stencil, you can add the master to it instead of creating a new one.

In the Save As dialog box, type a name for the new stencil, and then click Save.

On the File menu, point to Shapes, point to My Shapes, and then click the stencil that contains the copied master.

Right-click the title bar of the new stencil, and then click Edit Stencil on the shortcut menu.

Right-click the shape that you just added to the stencil, point to Edit Master and then click Edit Master Shape.

In the shape's edit window, right-click the shape, point to Data, and then click Shape Data.

When you see a message that asks if you want to define data now, click Yes.

Note: If the shape already contains data fields, you will not see this message, but you will continue through the remaining steps.

In the Define Shape Data dialog box, type a name for the field, and fill in any other information that you want. For example, you might want to change the data type or add a shape prompt at this time.

To create another field, click New and repeat step 8.

After you finish defining your data fields, click OK.

The Shape Data dialog box appears, showing your fields.

Note: If you want to make changes to the fields, click Define and repeat step 8.

To close the shape's edit window, on the File menu, click Close.

When you see a message that asks if you want to update the shape, click Yes.

When you see another message that asks if you want to save the changes to the stencil, click Yes.