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.

Shape Data window showing fields and values

Add data fields to selected shapes

  1. Select the shape or shapes that you want to add data to.
  2. Right-click the selection, point to Data on the shortcut menu, and then click Shape Data.
  3. 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.

  1. In the Define Shape Data dialog box, type a label for the field.
  2. To create another field, click New and repeat step 4.
  3. 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

  1. On the View menu, click Shape Data Window.
  2. 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.

Top of Page Top of Page

Create a reusable set of data fields

You can create a set of data fields that you can apply to shapes that you place in the drawing later, as well as to shapes that are already in your drawing.

  1. On the View menu, click Shape Data Window.
  2. Right-click anywhere in the Shape Data window, and then click Shape Data Sets.
  3. In the Shape Data Sets window, click Add.
  4. In the Add Shape Data Set dialog box, type a name for the data set.
  5. Select Create a new set, and then click OK.

The data set appears in the Name column of the Shape Data Sets window.

 Note   You can also click one of the other options if you want to change an existing data set.

  1. Under Name, click the new data set, and then click Define.
  2. In the Define Shape Data dialog box, type a label for the field.
  3. To create another field, click New and then repeat step 7.
  4. After all of your data fields are defined, click OK.
  5. To apply the data set to selected shapes in your drawing, select the set in the Shape Data Sets window, and then click Apply.

 Tip   To see your new fields in one of the shapes that you applied it to, select the shape, and then look in the Shape Data window.

Top of Page Top of Page

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.

  1. 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.

  1. In the Save As dialog box, type a name for the new stencil, and then click Save.
  2. On the File menu, point to Shapes, point to My Shapes, and then click the stencil that contains the copied master.
  3. Right-click the title bar of the new stencil, and then click Edit Stencil on the shortcut menu.
  4. Right-click the shape that you just added to the stencil, point to Edit Master and then click Edit Master Shape.
  5. In the shape's edit window, right-click the shape, point to Data, and then click Shape Data.
  6. 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.

  1. 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.
  2. To create another field, click New and repeat step 8.
  3. 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.

  1. To close the shape's edit window, on the File menu, click Close.
  2. When you see a message that asks if you want to update the shape, click Yes.
  3. When you see another message that asks if you want to save the changes to the stencil, click Yes.

Top of Page Top of Page

 
 
Applies to:
Visio 2007