RESOLVE_TEMPLATE function

RESOLVE_TEMPLATE function

Function Name Description Usage Input parameter Return value
RESOLVE_TEMPLATE Resolves references in a template string that contains $variable$ references. RESOLVE_TEMPLATE() NA Resolved template with the reference variable value.

Supported data type

The RESOLVE_TEMPLATE function supports the following data types:

  • JSON
  • String

Example: Resolve a JSON reference in a template JSON that contains a $variable$ reference.

Sample data:

$var1$ =
{
 "name": "Alex",
 "address": "$var2$",
 "age": "25"
}
$var2$ =
{
 "street": "1800 Amphibious Blvd",
 "city": "Mountain View",
 "state": "CA",
 "pincode": "94045"
}

Usage: $var1$.RESOLVE_TEMPLATE()

Resolve var2 variable reference in var1.

Output:

{
 "name": "Alex",
 "address": {
 "street": "1800 Amphibious Blvd",
 "city": "Mountain View",
 "state": "CA",
 "pincode": "94045"
 },
 "age": "25"
}

Example: Resolve a string reference in a template string that contains a $variable$ reference.

Sample data:

  • $var1$ = Hello $var2$
  • $var2$ = World

Usage: $var1$.RESOLVE_TEMPLATE()

Resolve var2 variable reference in var1.

Output: Hello World

Recommendation

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025年12月09日 UTC.