KS-23
March 29, 2026, 2:18pm
1
I’m doing a weapon database with a Base, and i have a property in every page of a weapon called origin. It’s a all lowecase, no space, name of the country, like southafrica. I want it to display something like “South Africa”.
The only way i can think of of doing this is by having a table or an array. I don’t know if it’s possible, but i hope so.
dawni
March 29, 2026, 3:46pm
2
A formula like this:
[
["South Africa", "southafrica"],
["Saint Kitts and Nevis", "saintkittsandnevis"],
["Bosnia and Herzegovina", "bosniaandherzegovina"],
["Democratic Republic of the Congo", "democraticrepublicofthecongo"]
].filter(value[1] == origin)[0][0]
1 Like
KS-23
March 29, 2026, 4:03pm
3
Huh, i didn’t know key-value arrays could be done in Obsidian.
When i put this in my Base, it only shows “South Africa”, but it doesn’t show anything for other ones like “argentina”.
I forgot to mention, but only some (ones that have two words mainly) values need to be replaced. The other ones can be handled using title()
dawni
March 29, 2026, 4:46pm
5
Oh of course. I wasn’t thinking. You can add a fallback for all the origins you didn’t list, and make it title case.
Try:
[
["South Africa", "southafrica"],
["Saint Kitts and Nevis", "saintkittsandnevis"],
["Bosnia and Herzegovina", "bosniaandherzegovina"],
["Democratic Republic of the Congo", "democraticrepublicofthecongo"],
["", origin]
].filter(value[1] == origin && origin)[0].map(if(value, value, origin.title()))[0]