Importing Data and Updating Individual Text Cells to Match

Started by ilovekorn, December 14, 2023, 05:11:53 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ilovekorn

Hello!  :) :D ;D

What I want to do:
Import data from an excel sheet and drag data onto page into one shape so I don't have to manually type everything each time.

The issue: When I drag the data from the imported Excel sheet, it generalizes it into the shape group, rather than the individual text cells I have already set up.

Screenshot 1: https://prnt.sc/2i0ycgIxOz4n (ALSO ATTACHED)
Description of Screenshot 1: The three green arrows show the mismatch. While the shape displays "PLANT", it should be "VAV" due to the data.

I did the way to show the text through Insert >> {selected my shape} >> Field >> Shape Data >> Serving
Of course "Serving" is just one category, but I did the same for Name, Device Type, IP Address, Network Number...

Please let me know if I am not clear on my issue.
|>falling away from me...<|

Surrogate

I find difference:
Sheet.2675 have cell Prop.Serving
Sheet.2674 have cell Prop._visDM_Serving

Linked cells usually always have _visDM_ prefix!

ilovekorn

Hi Surrogate,

I want to display all the linked cell data within each rectangle
Adding the prefix did not resolve that issue, how do I get it to populate on each individual cell?

https://prnt.sc/rTqbXNpgVJqv
|>falling away from me...<|

Surrogate

Quote from: ilovekorn on December 14, 2023, 07:54:57 PMAdding the prefix did not resolve that issue
This way dont works. Visio engine create these ShapeData cells when create external links!

Please check is some shapes are linked or not.

Surrogate

Quote from: ilovekorn on December 14, 2023, 07:54:57 PMI want to display all the linked cell data within each rectangle
Please try use this code for check is ShapeData row linked?
Sub CheckShapeData()
Dim sh As Shape ' variable for current shape (selected)
Dim sc As Section ' variable for ShapeData section
Dim r As Integer ' variable for ShapeData rows iteration
Dim rw As Row ' variable for current ShapeData row
Set sh = ActiveWindow.Selection.PrimaryItem ' define selected shape
Set sc = sh.Section(visSectionProp) ' define ShapeData section
For r = 0 To sc.Count - 1 ' define selected shape
    Set rw = sc.Row(r) ' define current ShapeData row
    Debug.Print rw.Cell(0).Name, rw.Cell(8).FormulaU ' output for row name (0) and DataLinked cell (8)
Next
End Sub

Quote from: OUTPUTProp.SubShapeType         FALSE
Prop.BelongsTo                FALSE
Prop._VisDM_F1              TRUE
Prop._VisDM_F2              TRUE

Sad but truth! You cant find DataLinked cell in ShapeSheet of this shape!

wapperdude

#5
This seems like same issue and solution per this post:  http://visguy.com/vgforum/index.php?topic=10261.msg47891#msg47891. See my replies.

When you drop a data entry onto the grouped shape, it gets all the categories/values.  That's fine.  It is your one stop storage.  Each shape in the membership can use Field Text Insert to pull in the desired category value.  Once the grouping is set, all should work as desired.

Visio makes the setup process quite easy.  If you haven't, you need to activate Developer mode.  Assuming that's true, and that you have a blank slate, that is, you just have plain, empty shapes, and they have been grouped.  The process is as follows...
  > 1) Select the group, then in the GUI>Developer>Shape Design category> select Behavior.  In the popup window, set Selection to group only.

  > 2) Next in the Behavior > Shape Name, note the ID number.  You'll use this.

  > 3) Now drop one of your Data fields onto the group.  Visio will automatically create Prop entries and name them according to the headings from Excel file.  That saves a bit of work and eliminates errors.

  > 4) Back to the GUI, and reset the Selection setting to either Group or Members first.  Each member is now ready to editing and setting the Field Insert.

  > 5) Select a member shape, then, from GUI, Insert>Field>Custom formula.  Enter the following syntax:  sheet.#!Prop.PropertyName where
      > # is the group ID noted above
      > PropertyName is the desired property as created by Visio in the top level group shape.

Repeat for each member shape.  When finished, each shape should show the desired property value.  You can now drop some other data field onto  this group or duplicate it and drop.
Visio 2019 Pro