Link to home
Start Free TrialLog in
Avatar of Kevin Self
Kevin Self

asked on

Simple linking of text field to imported excel

Lots of discussions shape data, but I can't seem to find this simple case.

1. I have four rectangles in my drawing. Each rectangle represents a desk. These are the only shapes in the drawing.

2. I have imported an excel spreadsheet using the Custom Import tool (using all the default settings). My spreadsheet has two columns and 5 rows. The Desk_Name column will be the unique identifier.
Desk_Name | Employee_Name
Desk1              | Alice
Desk2               |Bob
Desk3             | Charlie
Desk4             | Alice

3. I want the text field of rectangle 1 to display Alice, rectangle 2 to display Bob, etc. Desk4 is occupied by fourth employee also named Alice. I don't want the Desk_Name displayed. I don't want any text to appear off to the side of the shape, like I see in most of the examples. The only text that should appear inside the rectangle is the employee name.

4. The text inside the rectangles should be updated if I change any of the employee names. I don't expect this to happen automatically; I'll have to hit a refresh button somewhere.

5. *Eventually* the drawing will have up to 144 desks, and of course I will increase the size of the spreadsheet to match.

As I said, total noob with shape data. I know I have to assign a unique identifier (DeskName?) to each rectangle, and I have to link the text field of that shape to a specific excel cell, but I don't know how to start. To me this seems a simple case, but all the examples I've seen are for more complicated cases... Is there a simple solution for a simpleton?
Avatar of Scott Helmers
Scott Helmers
Flag of United States of America image

You are definitely headed in the right direction. For a simple way to get started, I would suggest the videos in the MVP Sessions. They were recorded for Visio 2010, so some buttons have different names or positions on the ribbon in Visio 2016, but the concepts are the same. In your case, take a look at #8 about linking diagrams to data. A scenario something like yours, in which you want to assign data to existing shapes starts around the 3:00 minute mark, but the whole video is only 7 minutes so I suggest watching all of it.

Once you've linked the diagram to data and see the External Data window, you need to link data rows to specific shapes. As you'll see in the video, you can drag a row of data onto a shape, which works fine when you have a small number of shapes. But when you have a lot of desks, you'll probably want to preset an ID field in each desk shape (your "Desk1", "Desk2", etc.) so that you can use automatic linking.

The other thing to do is to insert a text display field so that each person's name appears on the desk. Let's assume that the shape data field has the name "Occupant" (although the name of the field can be whatever you want it to be).
-- Select all desks
-- Insert>Text>Field
-- On the left side of the Field dialog box select Shape Data
-- On the right side of the Field dialog box select Occupant
-- Click OK
At this point each shape is set to display the contents of the occupant field. If the field is empty, nothing will appear on the desk. If the field contains data, it will appear.
Kevin,

Was the information above helpful? Do you need more assistance?

Scott
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.