Template Parameters
quip.apps.updateTemplateParams
Function(templateParams: { [paramName: string]: string }, isTemplate?: boolean) => void
Use quip.apps.updateTemplateParams
to set a JSON object of keys and values that will be copied to quip.app.InitOptions
during Live App's quip.apps.initialize
call after parsing through available mail merge values.
templateParams
is an object containing keys and values to pass during Live App initialization or in quip.apps.getTemplateParams
. If isTemplate
was set to true, any valid values in mail-merge syntax eg. “Account.Id” will be parsed and replaced (if initialized as template). See https://help.salesforce.com/articleView?id=sf.admin_files_quip_templates.htm&type=5 for mail merge syntax examples.
If you pass isTemplate: true
, this Live App will be put in “template mode”. While in “template mode”, values will be auto-filled from Salesforce records using mail merge syntax.
Example
quip.apps.updateTemplateParams({
"org_id":"00DT0000000D0000",
"record_id":"[[Account.Id]]",
"name":"[[Account.Name]]"
}, /* isTemplate */ true)
quip.apps.getTemplateParams
Function() => Promise<{
templateParams: {
[paramName: string]: string
},
isTemplate?: boolean
}>
Returns a promise that is resolved with the following values. This is good for displaying template parameters, but not for initialization - instead, use quip.apps.InitOptions
which will be mapped from these during Live App initialization.
templateParams
The template params object that was set during quip.apps.updateTemplateParams (note, this object does not contain mail-merged values).
isTemplate
Whether or not Live App is in “template mode“. See isTemplate in quip.apps.updateTemplateParams
for details.