Connecting data from external sources, such as Excel, Access, SQL Server or SharePoint, is a two-step process – import your data first, then connect it to shapes.
In this first step, use the Data Selector wizard to import your data into the External Data window.
- On the Data tab, in the External Data group, click Link Data to Shapes.
- On the first page of the Data Selector wizard, choose which of the following types of data sources you want to use:
Follow the instructions in the Data Selector wizard.
After you click Finish on the last page of the Data Selector wizard, the External Data window appears with your imported data shown in a table.
- Microsoft Excel workbook
- Microsoft Access database
- Microsoft SharePoint Foundation list
- Microsoft SQL Server database
- Other OLEDB or ODBC data source
- Previously created connection
The data in the External Data window is a snapshot of your source data at the time of import. You can refresh this data to match changes in your source data (click Refresh All on the Data tab), but Visio doesn’t send changes in the diagram back to the data source.
To hide the External Data window, on the Data tab, in the Show/Hide group, clear the External Data Window check box.
Link rows of data to shapes in your drawing
There are three ways to link rows of data to shapes in your drawing: You can link rows to existing shapes one at a time, you can link the rows to shapes automatically, or you can create shapes from the data.
Link rows to existing shapes one at a time
This approach is best for existing drawings with relatively few shapes, and doesn’t need special setup beforehand.
- Drag a row from the External Data window and drop it on a shape in your drawing.
- Select a shape, and then right-click a row of data and click Link to Selected Shapes on the shortcut menu. Use this method to link data to a container shape.
Your data appears by the shape, and a link icon appears in the External Data window to show that the row is linked to a shape. You can link a single row to multiple shapes, but each shape can be linked to only one row.
Automatically link rows to shapes
This approach is best for existing drawings with many shapes, but you have to prepare the shapes beforehand by giving them special Shape Data fields. The value in a Shape Data field has to match a value in a row of the data source so Visio can link that particular row with the shape that has the matching value.
For example, let’s say you have an Excel workbook that contains status data for computers on a network, and you want to use a network diagram to visually monitor computer status. In the workbook, each row of data corresponds to one computer. In this example, the Computer Name column is the unique identifier. To automatically link the correct rows in the workbook with the correct shapes in the diagram, add a Computer Name field to the Shape Data for each shape, fill in the field with the name of a unique computer in the network, and then start the Automatic Link wizard:
- On the Data tab, in the External Data group, click Automatically Link.
- Follow the instructions in the Automatic Link wizard.
In the example, on the wizard page that says Automatically link row to shape if, you would select Computer Name in the Data Column list, and also in the Shape Field list. When you finish the wizard, Visio links the rows and shapes that have matching values.
Create shapes from your data
This approach is best if your drawing does not already have shapes, and you do not have to use specific shapes.
- Select a shape in the Shapes window.
- Drag a row or set of rows from the External Data window onto a blank space in your drawing.
One instance of the selected shape appears for each row that you drag onto the drawing.
Format the data on the page
To add visual representation of the data, and make it easier to scan, apply custom data graphics to the shapes.