1

I don't know how this functionality is called, but I think Word had it for years. Basically, I want to do something like this:

{Character1} just got out of his bed when he heard a loud noise outside.

Where every instance of "{Character1}" is replaced later with "John":

John just got out of his bed when he heard a loud noise outside.

No, I'm not looking for a simple search and replace function, I want to know if I could add commonly used words, like a name in a story for example, to some sort of database and refer to that in the text, so that if I ever end up changing the name of the character, it will automatically get replaced everywhere.

Is there a functionality like that in Google Docs? If not, how is it called in Word? I've been looking for it forever, I just don't know how to refer to it.

0

For Microsoft Word, you can do it using fields. Before you can insert fields, you need to create them. Let's say we want to create a field called "Character". If you have Word 2007, 2010, 2013 or 2016, go to "File", "Info", "Properties" and then "Advanced Properties":

Find document properties

Switch to the "Custom" tab and type "Character" in the "Name" field. Then in "Value" field type "John" (or whatever name you want to use). Then click the "Add" button. Note that the "Add" button will not activate until you have inserted some text in the "Value" field:

Create field

Then click "Ok" and return to the document.

Now put your cursor where you want to insert the field:

Position cursor before insert field

Select "Insert" menu and from there "Quick Parts" then "Insert Field":

Insert Field

Select "DocProperty" from the list of field names and then select "Character" from the properties list:

Select character

Then click ok.

If you want to see all fields used in a document, press "CTRL+A" (i.e. select all). The field values will be highlighted in grey. I have added some more text to illustrate:

find fields

Now if you want to change the character name, you can go back to the "Advanced Properties" menu, change it there, then press "CTRL+A", right-click and select "Update Fields":

Update fields

In the pic below, I have updated it to "Adam":

Adam

  • 1
    I mean... thanks I guess, but that doesn't really answer my question. At least I know how it's called in Word, but I need it for Google Drive/Docs. – noClue Dec 22 '18 at 18:39
  • This functionality does not exist in Google Docs beyond the most basic find and replace functions. – Tyler Gubala Feb 14 at 17:32
0

Google Docs doesn't include an equivalent feature to Microsoft Word fields, on the user interface the closest feature is the one that you don't want to use, find and replace.

Another alternative is to use Google Apps Script or a Google Doc add-on, if one that does what you are looking for exists and is updated as required by Google (changes to the way that authorization are handled, and soon, published to the G Suite Marketplace instead of the Chrome Web Store).

References

0

I have the perfect solution for you. The new Google doc add-on "Reversible Formulas" enables you to insert and evaluate formulas in your Google document.

It offers three ways to achieve what you are looking for.

Simpler way: No formulas needed

Write in your doc:

John just got out of his bed when he heard a loud noise outside

Select "John". On the side panel replace "x" by "Character1" and click on "Name Selection"

Now every time you want to reuse this name, click on the newly created button "Character1" that appeared on the side panel. You can rename your character using the input on the right of the button, or rename it anywhere in the text and click on "Display values" to synchronize all occurrences.

Programmer way: Declare names explicitely

Write in your doc:

Character1 = John
=Character1 just got out of his bed when he heard a loud noise outside

Now click on "Display values". The declaration stays, but the formula is replaced by "John". You can write anywhere in the document =Character1 and later click on "Display Values" to have it replaced by "John" (you could also do in in the previous approach :-)). And as before, you can rename the occurrences of John anywhere in the doc or in the side panel.

Expert way: Declare names implicitly

Write in your doc:

=(/*Character1=*/"John") just got out of his bed when he heard a loud noise outside

Now click on "Display values". This is the equivalent of the "Name selection" button that you used in step 1, It's just that it inserted a formula with this syntax, so that it records the name of the value.

The add-on can be installed here: https://chrome.google.com/webstore/detail/formulas-for-google-docs/kgjbgmonlnhglokmfnpnklegakfknbeh

Disclaimer: I'm the author of the add-on

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.