Is there a verb for replacing placeholder values with actual values in a template?
For example:
The verb for transforming "Hello FirstName LastName" to "Hello John Smith".
Is there a verb for replacing placeholder values with actual values in a template?
For example:
The verb for transforming "Hello FirstName LastName" to "Hello John Smith".
One possibility is you populate the template (that's over 1000 written instances in Google Books).
Note that this use of populate is a bit "geeky", and thus likely to be restricted to software contexts. For more general contexts, it's worth noting that Google Books has nearly 9 times more instances of fill in the template.
I think you can use substituted. I derive this from @deadrat's comments above - "The OP's situation seems to call for 'parameter substitution.'"
use or add in place of/replace
In your case,
The placeholders, firstName and lastName were substituted with the actual values "John" and "Smith" respectively.
When referring to a template as a whole:
"Populate the template" "Fill in the template"
Here, the word 'template' should provide some context about there being placeholders that are being replaced.
However, if the verb is used without the word template in the context, it is not as clear that only specific placeholder part is being replaced:
"Populate first name" "Fill in first name"
In such a case, the word 'emplace' might be better: "Emplace first name"
Or maybe 'embed'?
The verb is
to instantiate
meaning to represent something by an instance. The act of instantiating is an instantiation:
the representation of (an abstraction) by a concrete example (logic)
or
the process of deriving an individual statement from a general one by replacing the variable with a name or other referring expression
Interpolate
In computer programming, string interpolation (or variable interpolation, variable substitution, or variable expansion) is the process of evaluating a string literal containing one or more placeholders, yielding a result in which the placeholders are replaced with their corresponding values.
I see there's some argument about whether the correct term is "instantiate" or "populate". I would humbly suggest the correct answer is: neither.
In common English, there is no single word that is widely recognized as meaning this. If you want to be clear, you would have to use a phrase or a whole sentence. Like, "Replace the place holders with specific values."
In IT ... "instantiate" simply does not mean this. Instantiate means to create an instance of an object. If you were talking about templates, we might well understand instantiate to mean to create an instance of the template. That might or might not include specifying values for variables. It would not normally be understood to mean parsing the template and replacing place holders with instance values. Maybe, possibly, the code to display or print the document would automagically pick up instance variables and substitute them in the right places. Or maybe not.
"Populate" is a pretty general term. Supplying values to be used to fill in the template could be referred to as "populating the object". But again, we wouldn't normally understand this to include parsing the template and substituting values.
If I was writing a program to do this, and the project leader told me, "Write a function to instantiate the template", I certainly would not interpret that to mean substituting for the place holders. I'd take that to mean writing a constructor, and/or the code to call the constructor.
For example, the JavaScript programming language includes "template strings" that function much like you describe. Mozilla, the people who wrote Firefox, describe this process like this:
Along with having normal strings, template literals can also contain other parts called placeholders, which are embedded expressions delimited by a dollar sign and curly braces: ${expression}. The strings and placeholders get passed to a function — either a default function, or a function you supply. The default function (when you don't supply your own) just performs string interpolation to do substitution of the placeholders and then concatenate the parts into a single string.
They then take about two pages to describe "string interpolation". My point being, they don't just say, "the string is instantiated" or "the string is populated". It takes them two pages to describe what happens. I think Mozilla is a pretty good authority on this subject, so if they think it takes a lengthy description and not one word, I'd believe them.
If I was told to "populate the template" ... maybe. I'd ask for clarification just what he meant.
"Detokenize." The placeholders are tokens, and the template has been tokenized. You're undoing that process.