How to add fields to a LibreOffice document

Woman using a laptop while working from home.

Getty Images

How many times have you created a document and had to add specific items, such as the current date, the number of pages, the author of the document, the time, a chapter, a file name, document statistics, a company name, or more? 

You can always manually add that information, but what if this is a document you use over and over, and you would rather not have to type out those bits every time you reuse the file?

That's where document fields come in handy. 

A field is a dynamic piece of information added to a file that is automatically updated as needed. 

For instance, if you add a date field, every time you reuse that document, the field will update to the current date. 

Also: How to password-protect a document with LibreOffice

Or maybe you want to add page numbers for the document, but you don't want to go through the arduous task of adding them manually. You could add a page number field that will automatically update, according to the number of pages in the document.

Fields are an incredibly handy way to not only add important data to your documents, but also make them more efficient to reuse.

Let me show you how fields work in the open-source, free LibreOffice office suite.

How to add fields to a LibreOffice document

Requirements

The only thing you'll need for this is a running instance of LibreOffice. It doesn't matter what operating system you use (Linux, MacOS, or Windows) as the feature works the same. That's it. Let's get to the fields.

The first thing to do is open LibreOffice. Once you have the application open, you can either work with a new document or call up a previous document that could benefit from a few fields.

The first thing we'll do is add a date field. Let's say you're creating a document template you'll use over and over. At the top of that template, you have:

To: 
From:
Re:
Date: 

Instead of always typing the date, you can add a field. To do that, click the space directly to the right of Date: and then click Insert > Field > Date. The field will be populated by the current date. 

Also: What's new in LibreOffice and how do you install it on MacOS?

If you were to open that same file tomorrow, the date would change to reflect that new date. You'll notice that there are other fields you can add in the Field submenu. If you click More Fields, the Fields popup opens where you can select from a number of different fields to add to your document.

The LibreOffice More Fields window.

LibreOffice includes plenty of pre-configured fields to add to your document.

Image: Jack Wallen

For the page number, you will probably want that in the footer of the document. For that, LibreOffice makes it even easier. Click anywhere at the bottom of the page to reveal the blue Footer (Default Page Style) button. Click + to enable the Footer and then click anywhere inside the footer to place the cursor. 

The Footer (Default Page Style) button will now have a drop-down arrow. Once you've placed the cursor in the footer, click the drop-down, and then select Insert Page Number. The page number will appear in the left corner of the footer and will automatically update as you add more pages to the document.

The LibreOffice footer drop-down.

Inserting a page number to a LibreOffice document.

Image: Jack Wallen

Adding other fields

Let's say you want to add your name to the From section at the top of the document. For that, place your cursor after From: and then click Insert > Field > First Author. 

If the author doesn't appear, it means you haven't configured LibreOffice with your name. To do that, click Tools > Options. In the resulting window, add your First and Last name in the User Data section.

The LibreOffice Options window.

Adding your personal information for LibreOffice to use in documents.

Image: Jack Wallen

Another helpful way to add fields is from the Document Properties function. Let's say this is going to be a long document and you want to be able to add your company address in various locations throughout the document. Instead of typing that out every time, you can add a new custom property to the document, and then add that address as a field. 

Also: How to get Microsoft Office for free

To do this, you must first add the Custom Field to the document by clicking File > Properties. In the resulting window, click Custom Properties, and then click Add Property. Click the far left drop-down and select Info. Select Text from the center drop-down, and then type the address for the Value. To save the new Custom Property, click OK.

The LibreOffice Document Properties window.

Adding a Custom Property to a LibreOffice Document.

Image: Jack Wallen

You can now add that field anywhere in the document by clicking Inset > Field > More Fields. In the resulting window, expand the Custom entry, select Info, and click Insert. The field will be inserted into the document. If you were to go into the Document Properties and change the address, it will automatically be updated in the document.

A Custom Property in the LibreOffice Fields window.

Our new Custom Property is now available to add as a field.

Image: Jack Wallen

And that's the gist of adding fields to a LibreOffice document. Once you get to know this feature, you'll be using it regularly to help make your workflow a bit more efficient.

Source