Extracting frontmatter for use in note and use as title on save

What I’m trying to do

Hi, I am using Templater to create a note. The note has the the following frontmatter values. I fill these in after creation of the note.

Day: 2-TUE
Lesson: 2
Subject: Humanities
Week: 23

I am looking to do 2 things:

  1. Create a heading in the note that is based on the frontmatter i.e

I have dataview installed but I can’t figure out how to extract the frontmatter values, concatenate them and represent as a test string for the heading. I suspect I need to use dataviewjs for this but can find no examples of a similar use.

  1. On saving the file I would like to rename the file with the name of the text string above i.e. 23-TUE-2-Humanities. I suspect I would use Templater for this but again can find no examples of a similar use.

Many thanks in advance for any help or pointers in the right direction.

Things I have tried

Searched forum for similar examples.
Searched Templater help.
Searched Dataview help.

Hi, I have managed to figure out (thanks Discord) how to create the title from the metadata,

## `$= dv.current().Week` - `$= dv.current().Day` - `$= dv.current().Lesson` - `$= dv.current().Subject`

If anyone could help with the automatic change of name on save (if it is possible to do this) it would be much appreciated. Many thanks