News:

BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

variable in GetRef function

Started by dmac101, April 04, 2023, 02:51:39 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dmac101

Hi All,
I am trying to set up a shape that updates a user cell in the page shapesheet based on a user selectable field
When i drop the shape onto the page i have a prompt to select an ID from a fixed list. I.e A1
I then want a formula to set a field on the page shape sheet corresponding to A1

for example SetF(GetRef(ThePage!User.ID),Prop.Attenuation)
So if Prop.ID = A1, then the above would be SetF(GetRef(ThePage!User.A1),Prop.Attenuation)

How do i set a variable into the formula so i can change the ID and evaluate it correctly?

Thanks
Darren

wapperdude

#1
It looks like you need to setup a dummy entry in the User Section of the page shape sheet to accept the formula.

Let's say for sake of argument, it is User.Row_9.  In the User.Row_9 Value cell, enter this formula:
SETF(GetRef(User.ID),"=setf(getref(Sheet.1!User.set" & Sheet.1!Prop.ID & "),Sheet.1!Prop.Val)").  This ends up pushing this formula into the User.ID cell =>  SETF(GetRef(Sheet.1!User.set5),Sheet.1!Prop.Val) 

In my test case, Sheet.1!Prop.ID had value = 5, and my Sheet.1 has a User.set5 row.  Now edit the User.Row_9 formula to reflect your exact needs.
Visio 2019 Pro

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 171 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1050KB.
Tokens: post-login.
Cache hits: 13: 0.00149s for 26,764 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]