dynamic field in pages template

I need help creating two dynamic fields that will appear in the footer. Because I have to answer and send a lot of letters with multiple references, I want to create a template that will be in one place in Pages and appear in the footer. Can someone help me with this?

Is this an appleScript issue or Pages?

This should be directly in Pages perhaps by a macro

How do you send your documents? I think it is not native Pages documents. It will be PDFs.
I suggest to add text overlay on PDF pages as footers.

We can get, add and remove annotations with PDFs by AppleScript using PDFKit.

https://piyomarusoft.booth.pm/items/5013927