Set variables on note or canvas, display variable value on other pages or canvas

What I’m trying to do

I want to be able to set a variable on one note or canvas page and then be able to call that variable on another note or canvas page.

I found a forum post that describes exactly what I am trying to do, unfortunately I was not able to recreate the solution and the thread was closed due to inactivity without a resolution.

I tried following the example from @Erisred but I can’t get the variables to populate. For both pages I toggled between reading and editing mode and that didn’t fix it.

I noticed in the example the dataview command after ‘=’ is highlighted in a darker shade and I am not seeing that on mine. I feel like that means the line is not being recognized as code but I am not sure how to fix that.

I have updated all my plug ins and made sure dataview is enabled. All of the toggles in the dataview settings section have also been enabled

I know just a tiny bit about coding so please speak slowly to me haha

@wlance007 - The dataview call is inside an inline codeblock - surrounded by backticks.

Test `=[[Variable Page]].var1`

Does that solve your issue?

That totally did it, Thanks!

Different but related question, is there a way to set a variable in a canvas card and then call it in a note? Or do I need to add notes from the vault into the canvas?

Sorry, I don’t use canvas so I’m not sure if it allows linking to cards or whether YAML is supported on them.
Someone else may have an answer for you.

ahh ok, Thanks for solving the original question though! I appreciate it!

Sorry, I kind of dismissed you when it got to something I didn’t know about. I could have at least pointed you in a direction that might help.

If you haven’t already done so, check with the folks on the Discord channel. They’re all super helpful and usually up for a challenge. I have no doubt somebody there can get you to your goal.

Good luck!