I wonder if we could include Named Ranges, like in Sheet or Excel?

I’m building my own game and I’m using Obsidian to write down the rules. But these rules need to appear in more than just one note.

In Sheets I would create a Named Range, like ‘CharacterName’, and then call upon that range in a cell where I would want that name displayed, by doing ‘=CharacterName’.

So for my example here, I might want to define a certain text. For example: ‘Strength Attack’. Now, somewhere in my notes (either in some meta space or on one of my notes) I could define ‘Strength Attack’ as ‘StrengthAttack’ = C2 and then write in C2 ‘- Strength Attack: Roll a d20 and add your Strength Score’. Anytime I would call upon ‘=StrengthAttack’ it would display the content of C2. This is very handy because everywhere that I’ve put the =StrengthAttack reference will display the same information and the only thing I have to do is change what is in C2 to change all the instances of that same information.

In Obsidian, we already have Properties. these look about the same. You Name a Property something and then tell it if it’s a date, text, etc. Why no create these Names ranges the same way so they can be called upon everywhere within the same Vault? Could be by using [[= ]] or something like that?

I am no programmer although I am quite creative when it comes to all thing IF THEN AND OR and such. But this seems to me like a logical inclusion in Obsidian? You could simple write these down on a Note, like:

Create Named Range: [[NamedRange=“StrengthAttack”|“- Strength Attack: Roll a d20 and add your Strength Score”]]
Call on Named range [[=StrengthAttack]]

Example:
You have to make a strength attack which is:

[[=StrengthAttack]]

Afterwards, roll for damage.

I am sure I’m not using the correct syntax but I think one would get the idea. you could even use it to reproduce a table or multiple lines?

I see three ways to do what you want:

  • Use embed with a section containing the info you want, ![[ExplainRule#StrengthAttack]]
  • Use embed with a block id, like in ![[ExplainRule#^StrengthAttack]]
  • If you use Dataview, then you could display properties directly: `= [[ExplainRule]].StrengthAttack `

Here I assume a note called ExplainRule with this content:

---
StrengthAttack: Description as a property
---

## StrengthAttack

Description as a section

## Various definitions

Desctription as a blockId. ^StrengthAttack

You’d only need one of them… :slight_smile: And they all has their pros and cons. A simple document listing all of these:

section: ![[ExplainRule#StrengthAttack]]

blockId: ![[ExplainRule#^StrengthAttack]]

dataview: `= [[ExplainRule]].StrengthAttack `

Which displays for me as:

image

Some styling can be applied to the various options, but I do believe that dataview is the only of these capable of doing inline replacing. (That is, to be included within another paragraph.

Thanks! I will try this out! I’ll come back to you with the results :smiley:

Thanks again!

I am very pleased with the BlockID option, but the dataview one is the one I really want. But I think I am misinterpreting something with how to create the section to which the dataview '= is referring. I am writing in the source of the note, but I only get a bold title and the = ’ command is returning nothing. If you have the time, can you walk me through setting that last one up in more detail?

Dearest regards,

Aranamarunda