({{, (RefLink[InsertionFunction, paclet:ref/InsertionFunction]) 
is an option for template functions that specifies how expressions are to be processed before they are inserted when the template is applied.}})

OpenersNotesSection(Spacer1)Details

With (RefLink[InsertionFunction, paclet:ref/InsertionFunction])->(RefLink[Automatic, paclet:ref/Automatic]), the following settings are used:

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Total data values before inserting them into a template slot:

t = TemplateSlot["data", InsertionFunction -> Total];
TemplateApply[t, <|"data" -> Table[RandomInteger[{1, i}], {i, 1, 100}]|>]

The (RefLink[InsertionFunction, paclet:ref/InsertionFunction]) ignores the (RefLink[Inherited, paclet:ref/Inherited]) function:

TemplateApply[
TemplateObject[TemplateSlot["data", InsertionFunction->Inherited], InsertionFunction -> ToString],
<|"data" -> Range[10]|>
]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CombinerFunction, paclet:ref/CombinerFunction])  ▪  (RefLink[TemplateObject, paclet:ref/TemplateObject])  ▪  (RefLink[StringTemplate, paclet:ref/StringTemplate])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[XML Templates, paclet:guide/XMLTemplates])}})}})