• Skip to main content
  • Skip to primary sidebar
  • Skip to footer

bVisual

  • Home
  • Services
    • How Visio smartness can help your business
    • Visio visual in Power BI
    • Visio Consulting Services
    • Visio Bureau Services
    • Visio Training and Support Services
  • Products
    • SS Plus
    • LayerManager
    • visViewer
    • Metro Icons
    • Rules Tools for Visio
    • The Visio 2010 Sessions App
    • Multi-Language Text for Visio
    • Document Imager for Visio
    • multiSelect for Visio
    • pdSelect for Visio
  • Case Studies
    • Case studies overview
    • Visualizing Construction Project Schedules
    • Visio Online Business Process Mapping
    • Nexans Visio Template
    • CNEE Projects, WorldCom
    • Chase Manhattan Bank
  • News
    • Recent news
    • News archive
  • Resources
    • Articles➡
      • ShapeSheet Functions A-Z
      • Comparing Visio for the Web and Desktop
      • Customising Visio Shapes for the Web App
      • Key differences between the Visio desktop and web apps
      • Using the Visio Data Visualizer in Excel
      • Using Visio in Teams
      • Creating Visio Tabs and Apps for Teams with SharePoint Framework (SPFx)
      • Designing Power Automate Flows with Microsoft Visio
      • Innovative uses of Visio Lists
    • Webcasts ➡
      • Visio in Organizations
      • My session and other Visio sessions at MSIgnite 2019
      • Power up your Visio diagrams
      • Vision up your Visio diagrams
      • The Visio 2010 MVP Sessions
    • Visio Web Learning Resources
    • Books➡
      • Mastering Data Visualization with Microsoft Visio
      • Microsoft Visio Business Process Diagramming and Validation
      • Visualizing Information with Microsoft Visio
  • Blog
    • Browse blog articles
    • Visio Power BI articles
    • Visio for Web articles
    • Visio blog on Orbus website
    • A history of messaging and encryption
  • About us
    • About bVisual
    • Testimonials
    • Bio of David Parker
    • Contact Us
    • Website Privacy Policy
    • Website terms and conditions
    • Ariba Network
You are here: Home / Visio / Referencing Container Data in Visio

Published on February 28, 2022 by David Parker

Referencing Container Data in Visio

Microsoft Visio has a useful Structured Diagramming concept that consists of Containers, Callouts and Connectors. The first of these features make it possible for shapes to know what they are contained within, as a better option to grouping shapes together. Grouping can hide or break the grouped shapes smartness, so Visio provides two ways of allowing shapes to be members of one or more containers. There are a few built-in Container shapes that can be added with the Insert / Diagram Parts / Container gallery, but shape developers can also create their own. Member shapes can be positioned anywhere within the container. There is a second type of container, List, that provides the ability to have ordered member items. There is no ribbon command to add these, but there are a number of these special shapes provided in the OOTB Visio stencils. For example, dragging and dropping a List box shape from the Software and Database / Software / Controls stencil will automatically add three List box item shapes to it.

There is a dedicated ribbon tab, Container Format, that appears when you select a container shape, which provides some extra commands, but I want to demonstrate how a member shape can reference data in its container shape in the ShapeSheet. I edited the Belt and List box masters in the Document Stencil above by adding a Title Shape Data row. Of course, I also ticked the Master Properties / Behavior / Match master by name on drop option to prevent Visio creating duplicate masters. I also ticked this for List box item master because I want to edit that too.

First, I simply added a Shape Data row to each master, but made them read-only so that they displayed the text in the heading shape of each.

The Belt master’s heading shape is Sheet.8, so the Prop.Title.Value cell formula is:

=GUARD(SHAPETEXT(Sheet.8!TheText))

The List box master’s heading shape is Sheet.6, so the Prop.Title.Value cell formula is:

=GUARD(SHAPETEXT(Sheet.6!TheText))

Next, I edited the text of the List box item master by using Insert / Field:

The following formula will either display the position of the item within its List container, or it will display that it is #0 of no list.

="#"&LISTORDER()&" of "&IFERROR(LISTSHEETREF()!Prop.Title,"no list")

The LISTORDER() function will return the position in the list, and LISTSHEETREF() function gets a reference to it. The ISERROR(…) function provides the fallback value if the specified cell does not exist in the referenced list container, or if there is no list container at all. The list container could also make use of the LISTMEMBERCOUNT() function if you wanted to display that.

The rectangle shape text was also edited to display the Title Shape Data of its container.

This is the simplest form of the CONTAINERSHEETREF(…) function, because it simply references the first container it is within:

"I am in "&CONTAINERSHEETREF(1)!Prop.TITLE

Of course, the CONTAINERSHEETREF(…) expression could also be enclosed within an IFERROR(…) function, to handle the case where there is no container. In addition, the CONTAINERSHEETREF(…) function has an optional second argument to filter the collection by a named shape category. There is also a CONTAINERCOUNT() function to get the total number of containers that a shape is within, and a CONTAINERMEMBERCONT() function for a container to get the number of members that it has.

Note that I had to re-drop a List box item shapes to use the new text formulas automatically.

These functions are also used extensively in Cross-Functional Flowchart diagrams, where multiple container shapes (swim-lanes) are found within a list shape. All of this functionality works in Visio for Web, so there is no excuse on making smart shapes for everyone!

A Multi-Time Zone Clock for Visio

I wrote a post about making a clock face in Visio fifteen years ago, but a reader recently asked about displaying multiple time zones. Well, I have previously written about time zones in Visio, so I accepted the challenge to improve upon my earlier work. (more…)

Update any Visio ShapeSheet cell with External Data

When Microsoft introduced a new way of linking external data to Visio shapes in 2007, I initially bemoaned the inability to update anything but Shape Data row values, unlike the old database add-on that I had been using for 10 years. The new method, though, has many advantages over the old way, not least that…

Understanding Morse Clicks with Visio

A few years ago, I wrote an article about messaging and encryption inspired by a visit to the National Museum of Computing in the UK. I developed a Morse Click shape to demonstrate how Visio can be used to represent and learn Morse Code. However, I never published the shapes here, and my good friend…

Correcting the Text Control Handle on Visio Network Shapes

There are literally thousands of master shapes in the stencils supplied with Microsoft Visio, so I guess that mistakes can creep in. One error that I have noticed is the inability of the default text control handle of many of the network shapes to actually move the text block horizontally. (more…)

Using a formula for Shape Data labels prevents multiple updates

I have only been developing Visio solutions for 25 years, but I got a surprise this week when I was trying to understand why I couldn’t update the value of a Shape Data row of multiple selected shapes. It is something that I often do, so it took me a while to understand why I…

Automatically displaying Visio shape text in other shapes

There are times, in Visio, when you just need to ensure that the text in a primary shape is synchronised with the text in different secondary shapes … even if they are on different pages of a Visio document. My previous article, Forcing Display Update of Inherited Data Values , describes a method of synchronising…

Related

Filed Under: Containers, Lists, ShapeSheet Formulas, Visio Tagged With: Containers, Lists, ShapeSheet Functions, Visio

About David Parker

David Parker has 25 years' experience of providing data visualization solutions to companies around the globe. He is a Microsoft MVP and Visio expert.

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

  • LinkedIn
  • Twitter

Recent Posts

  • TimeTable at RMConnect 2022
  • Custom Shapes in Visio in M365 and Web
  • A Multi-Time Zone Clock for Visio
  • Update any Visio ShapeSheet cell with External Data
  • Making Custom Shapes for Visio for M365

Categories

Tags

Accessibility Add-Ins Containers Data Export Data Graphics Data Import Data Visualizer Educational Excel GraphDatabase Hyperlinks Icon Sets JavaScript Layers Legend Link Data to Shapes MSIgnite MVP Office365 Org Chart PowerApps PowerBI PowerQuery Processes Shape Data Shape Design ShapeSheet ShapeSheet Functions SharePoint 2013 SQL Teams Themes Validation VBA Video Visio Visio 2007 Visio 2013 Visio for the Web Visio Online Visio Pro for Office365 Visio Services Visio Viewer Web Webinar

Footer

bVisual Profile

The UK-based independent Visio consultancy with a worldwide reach. We have over 25 years experience of providing data visualization solutions to companies around the globe.

Learn more about bVisual

  • LinkedIn
  • Twitter

Search this website

Recent posts

  • TimeTable at RMConnect 2022
  • Custom Shapes in Visio in M365 and Web
  • A Multi-Time Zone Clock for Visio
  • Update any Visio ShapeSheet cell with External Data
  • Making Custom Shapes for Visio for M365

Copyright © 2022 · Executive Pro on Genesis Framework · WordPress · Log in