Author Topic: Visio ShapeSheet ShapeData: keep two rows in sync  (Read 236 times)

0 Members and 1 Guest are viewing this topic.

chelmite

  • Jr. Member
  • **
  • Posts: 25
Visio ShapeSheet ShapeData: keep two rows in sync
« on: December 30, 2018, 02:07:07 PM »
I have two Shape Data rows for a Shape's ShapeSheet:

Shape Data  Label   Prompt   Type Format                                                     Value                       Invisible
Prop.Type   "Type"   ""         4 "Alpha;Beta;Gamma;Delta;Epsilon;Zeta;Eta;Theta;Iota;Kappa" INDEX(4,Prop.Type.Format)   False
Prop.Abbrev "Abbrev" No Formula 4 "A;B;G;D;E;Z;E;T;I;K"                                      INDEX(4,Prop.Abbrev.Format) True


The way I intent to use this is to have the user select the Type, say Epsilon, and then have the Abbrev automatically switch to the corresponding value in the Prop.Abbrev.Format.

Note: the values used here are placeholders for the actual values for my application, which are not shown here so they don't distract from the real answer I need, how to keep the selections in sync when the first one is selected or changed.

The "INDEX(,Prop.Type.Format)" is created automatically when a value is selected in the Shape Data dialog. How can I get access to the index value? ("4" in this case) What functions operate on the string array that is the Format field?

Thanks for any help you can give!

Yacine

  • Hero Member
  • *****
  • Posts: 2542
Re: Visio ShapeSheet ShapeData: keep two rows in sync
« Reply #1 on: December 30, 2018, 04:07:54 PM »
Hi Chelmite,
You don't want to synchronize the two lists.
What you want is the nth element of the second list.
n being the position of the element selected in the first list.
This position is: lookup(prop.type, prop.type.format)
Now you replace the number 4 from your post by this formula and you get:
  Prop.Abbrev = index(lookup(prop.type, prop.type.format), prop.abrrev.format)
https://docs.microsoft.com/en-us/office/client-developer/visio/lookup-function

Actually Prop.Abbrev doesn't even need to be a list. It can be a simple text (string) field - eg user.Abbrev for the calculated value and user.AbbrevList for the values list.
« Last Edit: December 30, 2018, 05:49:26 PM by Yacine »
Yacine

Surrogate

  • Hero Member
  • *****
  • Posts: 887
    • ShapeSheet™ Knowledge Base
Re: Visio ShapeSheet ShapeData: keep two rows in sync
« Reply #2 on: December 30, 2018, 10:46:59 PM »

chelmite

  • Jr. Member
  • **
  • Posts: 25
Re: Visio ShapeSheet ShapeData: keep two rows in sync
« Reply #3 on: December 31, 2018, 02:28:08 AM »
Ah, LOOKUP works on the stringified list! I thought it worked on a real list, which is why I rejected it.
Thank you!