A practical reference for building and troubleshooting Tag Templates in ScopeStack.
Overview
This guide assumes you're using Tag Templates with V2 merge data, which is required for this syntax to work correctly.
New to Tag Templates? Learn the concepts behind how they work in How Tag Templates Work in ScopeStack.
Template Syntax Basics
Purpose | Tag Syntax (V2 Required) |
---|---|
Text field | {field} |
Conditional | {#field} ...{/field} |
Looping | {#items} ...{/items} |
Rich text/HTML | {~~formatted_field} |
Important: Tag templates require V2 merge data to populate correctly.
Examples (Tag Templates)
The following are some examples of tags you can use in a document template to insert data.
High-level Project Details
Customer: {project.client_name}
Project Name: {project.project_name}
Printed On: {project.printed_on}
Contact Information
{#project.primary_contact}
{name} – {email} – {phone}
{/project.primary_contact}
Formatted Lists
{~~project.formatted_solution_summary}
Use ~~
to render markdown or nested HTML correctly in output.
Conditional Logic Examples
Conditional lists can be constructed in a couple of ways. For example, to insert logic if a MSA Date is present on a project, you can add the following value:
{#project.msa_date}
The client signed an MSA on {project.msa_date}
{/project.msa_date}
If you want to go further and define a condition to insert of the evaluation is false, you can add an extra step shown here:
{#project.msa_date}
The client signed an MSA on {project.msa_date}
{/project.msa_date}
{^project.msa_date}
The Client doesn't have an MSA with our company.
This project is subject to our standard terms and conditions found here:
https://scopestack.io/terms/
{/project.msa_date}
⚠️ Common Issues & Fixes
❌ Curly Quotes in Conditionals
Wrong:
{#name==“Deliverables”}
Fix (use straight quotes)
{#name=="Deliverables"}
❌ Missing Loop Closures
Wrong:
{#items}
Item: {name}
Fix:
{#items}
Item: {name}
{/items}
❌ No Render on formatted_sentences
-
If using Merge Fields: must manually loop over each sentence
-
If using Tags (with V2): use
{~~formatted_sentences}
to interpret HTML
🧾 Table Example: Pricing Resources
| Role | Hours | Rate | Total |
|------|-------|------|--------|
{#project_pricing.resources}{^resource_slug=="project_total"}
| {resource_name} | {description} | {quantity} | {hourly_rate | toFixed:2} | {total | toFixed:2} |
{/resource_slug=="project_total"}{/project_pricing.resources}
🧠 Best Practices
-
✅ Always use plain quotes, not curly quotes (
"
not“
) -
✅ Place tags or merge fields in their own clean paragraph
-
❌ Avoid putting them inside pre-styled elements like bullets or tables
-
✅ Use
{#field}
blocks to hide content when empty -
✅ Use
{~~...}
for any HTML/markdown fields in tag templates
📚 Merge Data Reference: project
Project-Level Fields
Here's a reference list of commonly used fields under the project
object for Tags (V2 only):
Project Name: {project.project_name}
Client Name: {project.client_name}
Account Name: {project.account_name}
MSA Date: {project.msa_date}
Submitted At: {project.submitted_at}
Approved At: {project.approved_at}
Created On: {project.created_on}
Printed On: {project.printed_on}
Project Version: {project.project_version}
Business Unit: {project.business_unit}
Tags: {project.tags}
Formatted narrative fields:
{~~project.formatted_executive_summary}
{~~project.formatted_solution_summary}
{~~project.formatted_our_responsibilities}
{~~project.formatted_customer_responsibilities}
{~~project.formatted_out_of_scope}
Version-specific details:
Current Version Name: {project.current_version.name}
Comment: {project.current_version.comment}
Created By: {project.current_version.created_by}
Created: {project.current_version.created}
Sales Executive (nested):
{#project.sales_executive}
Name: {name}
Email: {email}
{/project.sales_executive}
Rate Table:
Rate Table Name: {project.rate_table.name}
Slug: {project.rate_table.slug}
User-Defined Field:
Project Number: {project.user_defined_fields.project_number.value}
Pricing Summary Fields
Total Contract Revenue: {project_pricing.total_contract_revenue | toFixed:2}
Total Contract Value: {project_pricing.total_contract_value | toFixed:2}
Total Service Revenue: {project_pricing.total_service_revenue | toFixed:2}
Total Contract Cost: {project_pricing.total_contract_cost | toFixed:2}
Total Contract Profit: {project_pricing.total_contract_profit | toFixed:2}
Total Contract Margin: {project_pricing.total_contract_margin}
Customer Payment: {project_pricing.total_customer_payment | toFixed:2}
Example Loop Through Professional Services
{#project_pricing.professional_services.phases}
## Phase: {name}
{#services}
Service: {name}
Description: {~~formatted_service_description}
Hours: {total_hours}
Revenue: {total_revenue | toFixed:2}
Cost: {total_cost | toFixed:2}
PM Revenue: {pm_revenue | toFixed:2}
Resource: {resource_name}
Payment Model: {pricing_model}
{#language_fields}
{#name=="Deliverables"}
Deliverables:
{~~formatted_sentences}
{/name=="Deliverables"}
{/language_fields}
{/services}
{/project_pricing.professional_services.phases}
Subservices (if present)
{#subservices}
Subservice: {name}
{/subservices}
🧩 Example Template Download
You can download a working Tag Template Example here: 👉 Download Example Tag Template (.docx)
This document includes:
-
Project metadata
-
Services with nested language fields
-
Pricing breakdown tables
-
Contact and governance sections
-
Formatted lists and HTML-rich blocks