InformationArticle BodyExamples Use Case 1: Calculate total revenue Sum opportunity amounts and display the result in a summary cell. Example data: { Accounts: [ { Name: "Account 1", Opportunities: [ { Amount: 5000 }, { Amount: 7000 } ] }, { Name: "Account 2", Opportunities: [ { Amount: 2000 }, { Amount: 1000 } ] } ]} Template Document: Output: Use Case 2: Summarize product familes Create an array of product family summaries for an account. Example data: { "Account": { "Name": "Globex Corporation", "Subscriptions": [ { "ProductFamily": "Analytics", "ProductName": "InsightPro", "ARR": 120000, "RenewalDate": "2026-03-31" }, { "ProductFamily": "Collaboration", "ProductName": "TeamHub", "ARR": 45000, "RenewalDate": "2026-03-31" }, { "ProductFamily": "Analytics", "ProductName": "InsightPro AI", "ARR": 60000, "RenewalDate": "2026-03-31" } ], "Cases": [ { "CaseNumber": "00051024", "Severity": "High", "ProductFamily": "Analytics" }, { "CaseNumber": "00051055", "Severity": "Medium", "ProductFamily": "Collaboration" }, { "CaseNumber": "00051078", "Severity": "Low", "ProductFamily": "Analytics" } ] }} EXEC Tag Value: {#!// Assume Account is in scopeconst familyMap = {};// Step 1: Initialize summaries from subscriptionsfor (const sub of Account.Subscriptions) { if (!familyMap[sub.ProductFamily]) { familyMap[sub.ProductFamily] = { ProductFamily: sub.ProductFamily, TotalARR: 0, MostRecentRenewalDate: null, LowCaseCount: 0, MediumCaseCount: 0, HighCaseCount: 0 }; } const summary = familyMap[sub.ProductFamily]; // Add ARR summary.TotalARR += sub.ARR; // Update most recent renewal date const renewal = new Date(sub.RenewalDate); if ( !summary.MostRecentRenewalDate || renewal > new Date(summary.MostRecentRenewalDate) ) { summary.MostRecentRenewalDate = sub.RenewalDate; }}// Step 2: Tally case severitiesfor (const c of Account.Cases) { const summary = familyMap[c.ProductFamily]; if (!summary) continue; // skip if no subscription for this family if (c.Severity === "Low") summary.LowCaseCount++; if (c.Severity === "Medium") summary.MediumCaseCount++; if (c.Severity === "High") summary.HighCaseCount++;}// Step 3: Convert map to arrayconst productFamilySummaries = Object.values(familyMap);#} Template Document: Output: Notes If an EXEC tag is the only thing in a cell, then that cell's whole row will be deleted.Any variable defined in an EXEC tag can be used as a merge field in an INS tag later in the workbook.Variables defined in one sheet can be used in other sheets. Next Steps About EXEC EXEC in Word EXEC in PowerPoint EXEC in PDF TitleEXEC in ExcelURL NameEXEC-in-Excel