Visio smart shapes losing link to data on data refresh

Started by visio, April 19, 2024, 03:02:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

visio

Have a visio diagram using smartshapes which are linked to an excel spreadsheet. The idea is the smartshapes will redraw themselves depending on the data in the spreadsheet.

This is all working fine and the shapes are resizing and moving around the page fine. Can see the data successfully linked to shapes on the page depending on the shape name and a second data field. When doing link data to all shapes on the page this works fine.

Issue is if the data in the spreadsheet is changed and then a refresh data is requested on the visio diagram, all of the links between the shapes and the data are removed.

By carrying out the links data to all shapes on the page this restores the diagram with the new data. However this seems a bit heavy handed to be needed every time the data is refreshed.

Is something being missed in the data refresh process?

Yacine

That sounds weird indeed.
 Do you have unique IDs for the shapes?
Yacine

visio

Not that I can see. when the shapes are auto re-linked they absorb the data fine then reposition themselves accordingly.

When a data refresh is carried out after successfully linking the shapes the following message is seen

'The following shapes were linked to rows that could not be uniquely identified during refresh'
 
Is there any log or something that can be checked in visio?  Weird that the shape links automatically fine but then this  link is removed on refresh.

Nikolay

That looks that you have a problem with IDs.

How are the shapes matched against Excel rows? You need to have some field (excel column) that would identify a row from which to take data for the shape in Excel (that will not change between refresh operations). Looks like you are using some field that has the same value for all shapes.

Example:

SSN | Name | Salary
001 | John | 100
002 | Jack | 100
003 | Ted  | 100

If you use "Salary" as a key column, that would not work: all salaries are the same, Visio will not know what row corresponds to what shape.
You should select "SSN" (best) or "Name" (second best) as a key in the example above.

visio

Have deleted duplicates in shape data and have tried to add in the correct properties from the excel sheet.

So there are 7 columns in the excel sheet and 7 entries in the shape data. Shape links fine to the data but using a double key so in the example about SSN and Salary must both match so that makes thing unique.

When trying the data refresh yet again the link gets removed.

Is this an issue in the Shape data?  How is the data source selected correctly so shape data would be prop.mydata_SSN for data with a label of SSN. Typing htis in freeform and visio complains
 

Nikolay

You specify the key columns yourself when you link the data. Just select your two columns there. Here:



Am I missing something? Maybe you are using "Quick Import" from Excel? Use the standard one to set options (It's called "Custom" now)
Or edit them afterwards, using the "Edit Data Source" context menu.

visio

Ok some progress, the underlying issue is that the shape can occur twice depending on the data group it is in. So shape1 can occour in group1 and group2.  When linking the shape an AND rule is used to the shape.

So data column equals Shape Text (shape name) AND a property called Group equals Group. Doing this and the shape links fine, when a data refresh is carried out the link is removed so it would appear to be something to do with the 2 conditions required to marry up the data.

As a test the data source was adjusted so that the shape only occours once in the date for any given shapeName/group combination. This time the shape linked fine but then when a data refresh was carried out the shape link was maintained.

So how can a data refresh be carried out with 2 entries being used as a key?

Yacine

Take also care to have the prop naming both for actual row name and its label.
Eg prop.ID and its label = "ID"
Yacine

visio

Think that has done the trick, updated the data refresh and used the 'Configure refresh' option to change the refresh to use 2 unique identifiers. The link from the shape to the data is now maintained.

This is with a page with just 1 shape, will try and add in more shapes, with same name but in different groups and see if that works as expected.