Visio ShapeSheet ShapeData: keep two rows in sync

Started by chelmite, December 30, 2018, 07:07:07 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chelmite

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

#1
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.
Yacine


chelmite

Ah, LOOKUP works on the stringified list! I thought it worked on a real list, which is why I rejected it.
Thank you!