Parse pasted text and update front matter

What I’m trying to do

I am transitioning from using a gmail/zapier/trello combination that is automated for my new client intake process. I’d like to use Obsidian betterer in a client management/ CRM/ case management kind of way. I’ve created a new vault specifically for this purpose as I want to manage client data separately.

At the moment my intake flow is heavily automated using Trello Butler which makes life super simple but yo, my software platform overheads (and data insecurity) just keep creeping up.

The first step of the process is my intake, which involves an online calendar booking of a Meet & Greet call which generates an email for me with the following information and exact format:

Name: Exampla Pretendo
Phone: +6123456789
Email: [email protected]

Meet & Greet

What name would you like me to use on our call?

What are your pronouns?
She/ her

What is your current relationship structure? For example; Monogamous, Consensual Non-Monogamy (CNM), Polyamorous, Relationship Anarchy

How long have you been in this current relationship/ single?
10 years

How would you describe this relationship right now?
Acute and/or immediate distress

I’d like to be able to paste this text into a new note in Obsidian, and extract the following data into the front matter:
Name (listed in front matter as Partner 1:)
Phone (listed in front matter as Partner 1 Phone:)
email (listed in front matter as Partner 1 email:)
Pronouns (listed in front matter as Partner 1 pronouns)
Relationship structure
Length of relationship
Urgency (this information is selected from a multiple choice which includes "Acute and/or immediate distress)

Things I have tried

I’ve read widely on the forums and searched, but I think the terminology I am using isn’t correct so I’m not getting the hits. I’m not a coder and often feel like the solution is glimmering just out of reach but I can’t quite grasp it!

I have installed the community plug-ins Meta Bind and JS Engine because I think that somewhere here is my answer.

Perhaps the trick is to reformat the questions in my intake form to use in-line properties formatting with a double-double colon? That is, “::”

Or maybe something even simpler?

In principle, pasting your formatted information within the YAML header of a note already will include it in the frontmatter:

Name: Exampla Pretendo
Phone: +6123456789
Email: [email protected]

If you switch to source view, you will see that the “Properties” section actually is a YAML header:

  • The very first line of the header is ---
  • Then properties follow in the format property_name: property_value
  • That section is concluded with another ---.

Thus, it could be as simple as pasting the information directly, either

  • While in source mode—a hotkey can be setup to quickly switch to source mode and back, if preferred, or
  • After setting the option “Properties in document” to “Source”: then you can keep working in Live Preview mode, but properties will always be displayed as source code.

If you use the Dataview community plugin, then having the double-colon indeed is another option.

Note: [[email protected]](mailto:[email protected]) is not valid content for the properties. Just enter the email address, and it automatically will appear as a clickable mailto: link in the properties

Hi vanadium - thanks for your reply!

You’re exactly right, and I’d like to take it a step further. Apologies, my original post might not have been clear, I’ll revise that.

What I want is to draw information from ALL the answers I posted from the intake quiz (not just the name, phone, email) and update the front matter.

I think now that the solution will be something like;

  1. JS engine find and replace script to;

Find “Name:” and replace with “Partner 1:”
Find “What are your pronouns” and replace with “Partner 1 Pronouns:”

and so on.

  1. Bind the script to a button.

Does that make more sense? I’m trying very hard to do those parts myself but missing huge chunks of know-how.

You will need to reformat. To automate that, scripting will be unavoidable.

If you control the server, you could have it output the information directly in a form suited for Obsidian. Else, it could be an external script that reformats the incoming text that is saved in a file. Such script also could automatically place the formatted note in your vault. Thirdly, with the vast availability of community scripts, there are several options to reformat pasted text directly in Obsidian.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.