Hi I am new to Obsidian and one thing I want to do with it is to store some contact information as a CRM in Obsidian.
What I’m trying to do
I would like to create a CRM.
I would like to split some of the data into seperat files.
The structure should be like:
- Peter_Parker - Some basic information and notes about what we are talking.
- Peter_Parker_biz - Information about my Business with Peter
- Peter_Parker_privat - Some privat notes about Peter that should not been showen directly, when I open the main contacts page.
- … several other topics
For Example:
- I create a file with the name “Peter_Parker”.
This file will have some basic information about Peter. - Now I would also like to add other files to Peter where I for examlpe save some business related information.
That file should be named Peter_Parker_biz. - The *_biz file dose not nesseserly need to be created when creating “Peter_Parker”.
I would like to have a row in the Frontmatter:
BIZ-Information: [[Peter_Parker_biz]]
When I click that link, the *_biz file should be created based on an other template as the main contact.
Perfect would be if the files are in the same folder but can base on different templates.
The *_biz file should base on an other template.
Things I have done / what works
- I created a template for the main document and set it up together with templater.
- When I create a new document inside of my peoples folder, the template is triggert.
- The template inclueds some code I found here in the forum or on an noter web page (I am not 100 % sure, where I all have searched and found different things)
If the Files name is “Untitled”, a PopUp window accours to imput the file name.
The file is then renamed and the name is also written into the ducument.
---
fileClass: People
tags:
- people
lastContact:
biz_data: <% "hereShouldBeALinkToBizInformation" %>
---
<%*
let title = tp.file.title
if (title.startsWith("Untitled")) {
title = await tp.system.prompt("Title");
await tp.file.rename(`${title}`);
}
%>
# <%* tR += `${title}` %>
## Notes
<% tp.file.cursor() %>
Things I have tried
Now I am stuck with two topics
-
I tried to set up a biz-template in templater plugin.
But I get an error, that I can’t do two templates for the same folder.
I searched for a solution to add the different templates based on filename (file ends with _biz) or something different but did not fond a solution.
The only way I found is a subfolder.
For example:
/People/ …here are the main contact information stored
/People/Biz/ …here are the biz-information stored.
Is there a better way? -
How to add the link to the biz-file into the front matter row?
I think, I need to concatenate somehow the filename with the extention "_biz.
But I can’t find the right syntax.
In the following example biz_data adds a link to _biz in general. That works.
Now I need to add the filename in front of _biz.
But the result of row biz_data2 showes “untitled_biz”. So, it is not the name, I write into the pop up prompt, when adding the new document.
The row biz_data3: I tried several different styles of writing, reading the templater doc (but not fully understanding), … The different versions all endet in two different ways. a) the front matter block isn’t valid any more. b) when creating a new document, templater is showing an error message.
---
fileClass: People
tags:
- people
lastContact:
biz_data: [[ <% "_biz" %> ]]
biz_data2: [[ <% tp.file.title %><% "_biz" %>]]
biz_data3: [[ <% title %><% "_biz" %>]]
---
Any suggestions???