export function agencyFeedbackSurvey(form: FormTs) {
// Agency Performance Review - B2B agency evaluation
// Demonstrates: MatrixQuestion (extensive), StarRating, RatingScale (NPS), Slider, EmojiRating, Pages
// ============================================
// HEADER
// ============================================
form.addRow(row => {
row.addTextPanel('header', {
label: 'Agency Performance Review',
computedValue: () => 'Help us evaluate our agency partnership and identify areas for improvement.',
customStyles: {
backgroundColor: '#0f172a',
color: 'white',
padding: '24px',
borderRadius: '12px',
textAlign: 'center'
}
});
});
// ============================================
// SECTION 1: Engagement Context
// ============================================
const contextSection = form.addSubform('context', {
title: 'Engagement Details'
});
contextSection.addRow(row => {
row.addDropdown('agencyType', {
label: 'Agency Type',
placeholder: 'Select agency type...',
options: [
{ id: 'marketing', name: 'Marketing / Digital Marketing' },
{ id: 'creative', name: 'Creative / Design' },
{ id: 'pr', name: 'PR / Communications' },
{ id: 'advertising', name: 'Advertising' },
{ id: 'branding', name: 'Branding' },
{ id: 'social', name: 'Social Media' },
{ id: 'content', name: 'Content / SEO' },
{ id: 'media', name: 'Media Buying' },
{ id: 'fullService', name: 'Full Service' },
{ id: 'other', name: 'Other' }
],
isRequired: true
}, '1fr');
row.addDropdown('engagementLength', {
label: 'Engagement Duration',
placeholder: 'Select duration...',
options: [
{ id: 'under6', name: 'Less than 6 months' },
{ id: '6to12', name: '6-12 months' },
{ id: '1to2years', name: '1-2 years' },
{ id: '2to5years', name: '2-5 years' },
{ id: 'over5', name: 'Over 5 years' }
]
}, '1fr');
});
contextSection.addRow(row => {
row.addRadioButton('reviewType', {
label: 'This review is for:',
options: [
{ id: 'quarterly', name: 'Quarterly Business Review (QBR)' },
{ id: 'annual', name: 'Annual Evaluation' },
{ id: 'project', name: 'Project/Campaign Completion' },
{ id: 'renewal', name: 'Contract Renewal Decision' },
{ id: 'adhoc', name: 'Ad-hoc Feedback' }
],
orientation: 'vertical'
});
});
// ============================================
// SECTION 2: Core Performance - Matrix Rating
// ============================================
const performanceSection = form.addSubform('performance', {
title: 'Core Performance Evaluation'
});
performanceSection.addRow(row => {
row.addMatrixQuestion('corePerformance', {
label: 'Rate your agency on the following dimensions:',
rows: [
{ id: 'creativity', label: 'Creativity & Innovation', isRequired: true },
{ id: 'strategy', label: 'Strategic Thinking', isRequired: true },
{ id: 'execution', label: 'Project Execution', isRequired: true },
{ id: 'quality', label: 'Work Quality', isRequired: true },
{ id: 'timeliness', label: 'Meeting Deadlines' },
{ id: 'budget', label: 'Budget Management' }
],
columns: [
{ id: '1', label: 'Poor' },
{ id: '2', label: 'Below Exp.' },
{ id: '3', label: 'Meets Exp.' },
{ id: '4', label: 'Exceeds' },
{ id: '5', label: 'Outstanding' }
],
striped: true,
fullWidth: true
});
});
// ============================================
// SECTION 3: Working Relationship
// ============================================
const relationshipSection = form.addSubform('relationship', {
title: 'Working Relationship'
});
relationshipSection.addRow(row => {
row.addMatrixQuestion('relationshipRating', {
label: 'Rate the working relationship:',
rows: [
{ id: 'communication', label: 'Communication Quality', isRequired: true },
{ id: 'responsiveness', label: 'Responsiveness', isRequired: true },
{ id: 'proactivity', label: 'Proactive Suggestions' },
{ id: 'understanding', label: 'Understanding of Your Business' },
{ id: 'chemistry', label: 'Team Chemistry' },
{ id: 'transparency', label: 'Transparency & Honesty' }
],
columns: [
{ id: 'poor', label: 'Poor' },
{ id: 'fair', label: 'Fair' },
{ id: 'good', label: 'Good' },
{ id: 'excellent', label: 'Excellent' }
],
striped: true,
fullWidth: true
});
});
// ============================================
// SECTION 4: Value & Results
// ============================================
const valueSection = form.addSubform('value', {
title: 'Value & Results'
});
valueSection.addRow(row => {
row.addStarRating('valueForMoney', {
label: 'Value for money',
maxStars: 5,
size: 'lg',
alignment: 'center'
});
});
valueSection.addRow(row => {
row.addSlider('budgetUtilization', {
label: 'How well does the agency manage your budget? (%)',
min: 0,
max: 100,
step: 5,
unit: '%',
showValue: true,
defaultValue: 80
});
});
valueSection.addRow(row => {
row.addRatingScale('resultsDelivery', {
label: 'How well does the agency deliver measurable results?',
preset: 'likert-5',
lowLabel: 'No results',
highLabel: 'Exceptional results',
alignment: 'center'
});
});
valueSection.addRow(row => {
row.addRadioButton('roiPerception', {
label: 'How would you describe the ROI from this agency?',
options: [
{ id: 'excellent', name: 'Excellent - significantly exceeds investment' },
{ id: 'good', name: 'Good - meets or slightly exceeds investment' },
{ id: 'fair', name: 'Fair - approximately breaks even' },
{ id: 'poor', name: 'Poor - below expectations' },
{ id: 'unknown', name: 'Difficult to measure' }
],
orientation: 'vertical'
});
});
// ============================================
// SECTION 5: Strengths & Weaknesses
// ============================================
const swSection = form.addSubform('strengthsWeaknesses', {
title: 'Strengths & Development Areas'
});
swSection.addRow(row => {
row.addSuggestionChips('strengths', {
label: 'What are this agency\'s key strengths?',
suggestions: [
{ id: 'creativity', name: 'Creativity' },
{ id: 'strategy', name: 'Strategy' },
{ id: 'execution', name: 'Execution' },
{ id: 'design', name: 'Design quality' },
{ id: 'data', name: 'Data & Analytics' },
{ id: 'speed', name: 'Speed' },
{ id: 'flexibility', name: 'Flexibility' },
{ id: 'expertise', name: 'Industry expertise' }
],
alignment: 'left'
});
});
swSection.addSpacer();
swSection.addRow(row => {
row.addSuggestionChips('weaknesses', {
label: 'What areas need improvement?',
suggestions: [
{ id: 'creativity', name: 'Creativity' },
{ id: 'strategy', name: 'Strategy' },
{ id: 'execution', name: 'Execution' },
{ id: 'communication', name: 'Communication' },
{ id: 'deadlines', name: 'Meeting deadlines' },
{ id: 'budget', name: 'Budget management' },
{ id: 'proactivity', name: 'Proactivity' },
{ id: 'staffing', name: 'Team/Staffing' }
],
alignment: 'left'
});
});
// ============================================
// SECTION 6: Overall Satisfaction
// ============================================
const overallSection = form.addSubform('overall', {
title: 'Overall Assessment'
});
overallSection.addRow(row => {
row.addEmojiRating('overallSatisfaction', {
label: 'Overall satisfaction with this agency:',
preset: 'satisfaction',
size: 'lg',
showLabels: true,
alignment: 'center'
});
});
overallSection.addSpacer();
overallSection.addRow(row => {
row.addRatingScale('recommendAgency', {
label: 'How likely are you to recommend this agency to a colleague?',
preset: 'nps',
showSegmentColors: true,
showCategoryLabel: true,
alignment: 'center'
});
});
// ============================================
// SECTION 7: Future Direction
// ============================================
const futureSection = form.addSubform('future', {
title: 'Future Direction'
});
futureSection.addRow(row => {
row.addRadioButton('continueEngagement', {
label: 'Based on this evaluation, you would:',
options: [
{ id: 'expand', name: 'Expand the relationship (more projects/budget)' },
{ id: 'maintain', name: 'Maintain current engagement level' },
{ id: 'reduce', name: 'Reduce scope or budget' },
{ id: 'review', name: 'Put the relationship under review' },
{ id: 'terminate', name: 'Consider termination' }
],
orientation: 'vertical'
});
});
futureSection.addRow(row => {
row.addCheckboxList('growthAreas', {
label: 'Areas where you\'d like to see the agency grow with you:',
options: [
{ id: 'digital', name: 'Digital marketing' },
{ id: 'social', name: 'Social media' },
{ id: 'content', name: 'Content creation' },
{ id: 'analytics', name: 'Analytics & insights' },
{ id: 'strategy', name: 'Strategic consulting' },
{ id: 'creative', name: 'Creative services' },
{ id: 'media', name: 'Media planning/buying' },
{ id: 'pr', name: 'PR & communications' }
],
orientation: 'vertical',
isVisible: () => {
const decision = futureSection.radioButton('continueEngagement')?.value();
return decision === 'expand' || decision === 'maintain';
}
});
});
// ============================================
// SECTION 8: Detailed Feedback
// ============================================
const feedbackSection = form.addSubform('feedback', {
title: 'Detailed Feedback'
});
feedbackSection.addRow(row => {
row.addTextarea('positives', {
label: 'What does this agency do particularly well?',
placeholder: 'Share specific examples of excellent work...',
rows: 3,
autoExpand: true
});
});
feedbackSection.addSpacer();
feedbackSection.addRow(row => {
row.addTextarea('improvements', {
label: 'What specific improvements would you like to see?',
placeholder: 'Be specific about areas for development...',
rows: 3,
autoExpand: true
});
});
feedbackSection.addRow(row => {
row.addCheckbox('shareWithAgency', {
label: 'Share this feedback with the agency during our review session',
defaultValue: true
});
});
// ============================================
// SECTION 9: Summary
// ============================================
const summarySection = form.addSubform('summary', {
title: 'Evaluation Summary',
isVisible: () => overallSection.emojiRating('overallSatisfaction')?.value() !== null
});
summarySection.addRow(row => {
row.addTextPanel('summaryContent', {
computedValue: () => {
const agencyType = contextSection.dropdown('agencyType')?.value();
const satisfaction = overallSection.emojiRating('overallSatisfaction')?.value();
const nps = overallSection.ratingScale('recommendAgency')?.npsCategory();
const value = valueSection.starRating('valueForMoney')?.value();
const roi = valueSection.radioButton('roiPerception')?.value();
const decision = futureSection.radioButton('continueEngagement')?.value();
const strengths = swSection.suggestionChips('strengths')?.value() || [];
const weaknesses = swSection.suggestionChips('weaknesses')?.value() || [];
if (!satisfaction) return '';
const typeLabels: Record<string, string> = {
'marketing': 'Marketing', 'creative': 'Creative', 'pr': 'PR',
'advertising': 'Advertising', 'branding': 'Branding',
'social': 'Social Media', 'content': 'Content/SEO',
'media': 'Media', 'fullService': 'Full Service', 'other': 'Other'
};
const satisfactionLabels: Record<string, string> = {
'very-bad': '😢 Very Dissatisfied',
'bad': '😕 Dissatisfied',
'neutral': '😐 Neutral',
'good': '🙂 Satisfied',
'excellent': '😃 Very Satisfied'
};
const decisionLabels: Record<string, string> = {
'expand': '📈 Expand relationship',
'maintain': '✓ Maintain current level',
'reduce': '📉 Reduce scope',
'review': '⚠️ Under review',
'terminate': '❌ Consider termination'
};
let emoji = satisfaction === 'excellent' || satisfaction === 'good' ? '✅' : satisfaction === 'neutral' ? '⚠️' : '❌';
let summary = `${emoji} Agency Performance Summary\n`;
summary += `${'═'.repeat(35)}\n\n`;
if (agencyType) {
summary += `Type: ${typeLabels[agencyType] || agencyType} Agency\n`;
}
summary += `Satisfaction: ${satisfactionLabels[satisfaction] || satisfaction}\n`;
if (value) {
summary += `Value Rating: ${'⭐'.repeat(value)} (${value}/5)\n`;
}
if (nps) {
const npsLabels: Record<string, string> = {
'promoter': 'Would recommend',
'passive': 'Neutral on recommendation',
'detractor': 'Would not recommend'
};
summary += `NPS: ${npsLabels[nps]}\n`;
}
if (decision) {
summary += `\nDecision: ${decisionLabels[decision] || decision}\n`;
}
if (strengths.length > 0) {
summary += `\n💪 Strengths: ${strengths.length} identified`;
}
if (weaknesses.length > 0) {
summary += `\n🔧 Improvements: ${weaknesses.length} identified`;
}
return summary;
},
customStyles: () => {
const satisfaction = overallSection.emojiRating('overallSatisfaction')?.value();
const baseStyles = {
padding: '16px',
borderRadius: '8px',
whiteSpace: 'pre-wrap',
fontFamily: 'monospace',
fontSize: '14px'
};
if (satisfaction === 'excellent' || satisfaction === 'good') {
return { ...baseStyles, backgroundColor: '#f0f9ff', borderLeft: '4px solid #0284c7' };
} else if (satisfaction === 'neutral') {
return { ...baseStyles, backgroundColor: '#fef3c7', borderLeft: '4px solid #f59e0b' };
} else {
return { ...baseStyles, backgroundColor: '#fee2e2', borderLeft: '4px solid #ef4444' };
}
}
});
});
// ============================================
// FORM CONFIGURATION
// ============================================
form.configureSubmitButton({
label: 'Submit Evaluation',
isVisible: () => overallSection.emojiRating('overallSatisfaction')?.value() !== null
});
form.configureCompletionScreen({
type: 'text',
title: 'Evaluation Submitted',
message: 'Thank you for completing this agency performance review. Your feedback will be used to strengthen our agency partnerships and drive better results. If you opted to share this feedback, it will be reviewed during your next agency meeting.'
});
}