export function crmFinderQuiz(form: FormTs) {
form.setTitle(() => '🎯 Find Your Perfect CRM');
// ============ STATE ============
const preferences = form.state<{
teamSize: string;
budget: string;
priorities: string[];
industry: string;
techLevel: string;
integrations: string[];
}>({
teamSize: '',
budget: '',
priorities: [],
industry: '',
techLevel: '',
integrations: []
});
// ============ CRM DATABASE ============
type CRMKey = 'hubspot' | 'salesforce' | 'pipedrive' | 'zoho' | 'monday' | 'freshsales';
const crmDatabase: Record<CRMKey, {
name: string;
logo: string;
tagline: string;
bestFor: string;
priceRange: string;
strengths: string[];
considerations: string[];
idealTeamSize: string[];
techLevel: string[];
}> = {
hubspot: {
name: 'HubSpot CRM',
logo: '🟠',
tagline: 'All-in-one platform for marketing, sales & service',
bestFor: 'Growing businesses wanting an integrated platform',
priceRange: 'Free - $1,200+/mo',
strengths: ['Free tier available', 'Marketing automation built-in', 'Excellent UI/UX', 'Great for inbound marketing'],
considerations: ['Can get expensive at scale', 'Some features locked to higher tiers'],
idealTeamSize: ['1-5', '6-20', '21-50'],
techLevel: ['beginner', 'intermediate']
},
salesforce: {
name: 'Salesforce',
logo: '☁️',
tagline: 'The world\'s #1 CRM platform',
bestFor: 'Enterprise companies with complex sales processes',
priceRange: '$25 - $300+/user/mo',
strengths: ['Extremely customizable', 'Massive app ecosystem', 'Advanced analytics', 'Industry solutions'],
considerations: ['Steep learning curve', 'Requires admin expertise', 'Higher cost'],
idealTeamSize: ['21-50', '51-200', '200+'],
techLevel: ['intermediate', 'advanced']
},
pipedrive: {
name: 'Pipedrive',
logo: '🟢',
tagline: 'Sales CRM designed by salespeople',
bestFor: 'Sales-focused teams wanting simplicity',
priceRange: '$14 - $99/user/mo',
strengths: ['Visual pipeline management', 'Easy to use', 'Activity-based selling', 'Great mobile app'],
considerations: ['Limited marketing features', 'Basic reporting on lower tiers'],
idealTeamSize: ['1-5', '6-20', '21-50'],
techLevel: ['beginner', 'intermediate']
},
zoho: {
name: 'Zoho CRM',
logo: '🔴',
tagline: 'Feature-rich CRM at competitive prices',
bestFor: 'Budget-conscious teams wanting full features',
priceRange: 'Free - $52/user/mo',
strengths: ['Excellent value', 'AI assistant (Zia)', 'Part of Zoho ecosystem', 'Highly customizable'],
considerations: ['UI less polished', 'Can feel overwhelming'],
idealTeamSize: ['1-5', '6-20', '21-50', '51-200'],
techLevel: ['beginner', 'intermediate', 'advanced']
},
monday: {
name: 'Monday Sales CRM',
logo: '🟣',
tagline: 'Visual, flexible work management meets CRM',
bestFor: 'Teams wanting CRM + project management',
priceRange: '$10 - $24+/user/mo',
strengths: ['Highly visual', 'Flexible workflows', 'Easy collaboration', 'Quick to set up'],
considerations: ['Newer to CRM space', 'Less sales-specific features'],
idealTeamSize: ['1-5', '6-20', '21-50'],
techLevel: ['beginner', 'intermediate']
},
freshsales: {
name: 'Freshsales',
logo: '🟡',
tagline: 'AI-powered CRM for high-velocity sales',
bestFor: 'SMBs wanting AI features at reasonable price',
priceRange: 'Free - $69/user/mo',
strengths: ['Built-in phone & email', 'AI lead scoring', 'Clean interface', 'Good automation'],
considerations: ['Smaller ecosystem', 'Less third-party integrations'],
idealTeamSize: ['1-5', '6-20', '21-50'],
techLevel: ['beginner', 'intermediate']
}
};
// ============ SCORING LOGIC ============
const scores = form.state<Record<CRMKey, number>>({
hubspot: 0,
salesforce: 0,
pipedrive: 0,
zoho: 0,
monday: 0,
freshsales: 0
});
const updateScores = (crmScores: Partial<Record<CRMKey, number>>) => {
scores.update(current => {
const updated = { ...current };
for (const [crm, points] of Object.entries(crmScores)) {
updated[crm as CRMKey] = (updated[crm as CRMKey] || 0) + (points as number);
}
return updated;
});
};
const getTopCRMs = (): CRMKey[] => {
const s = scores();
const sorted = Object.entries(s).sort((a, b) => b[1] - a[1]);
return sorted.slice(0, 3).map(([crm]) => crm as CRMKey);
};
const getTopCRM = (): CRMKey => getTopCRMs()[0] || 'hubspot';
// ============ COMPLETION SCREEN ============
form.configureCompletionScreen({
type: 'text',
title: () => {
const top = getTopCRM();
return `${crmDatabase[top].logo} ${crmDatabase[top].name} is Your Best Match!`;
},
message: () => {
const top = getTopCRM();
return `${crmDatabase[top].tagline}\n\nBest for: ${crmDatabase[top].bestFor}\n\nDownload your detailed comparison report to see why this CRM fits your needs.`;
}
});
// ============ PAGES SETUP ============
const pages = form.addPages('quiz-pages', {
heightMode: 'current-page'
});
// ============ PAGE 1: Company Profile ============
const page1 = pages.addPage('company', { mobileBreakpoint: 500 });
page1.addRow(row => {
row.addTextPanel('header1', {
label: 'Step 1 of 6: About Your Business',
computedValue: () => 'Tell us about your company to find the right fit',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page1.addSpacer({ height: '24px' });
page1.addRow(row => {
row.addRadioButton('teamSize', {
label: 'How many people will use the CRM?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: '1-5', name: '👤 1-5 users (Small team)' },
{ id: '6-20', name: '👥 6-20 users (Growing team)' },
{ id: '21-50', name: '🏢 21-50 users (Medium business)' },
{ id: '51-200', name: '🏛️ 51-200 users (Large business)' },
{ id: '200+', name: '🌍 200+ users (Enterprise)' }
],
onValueChange: (val) => {
if (!val) return;
preferences.update(c => ({ ...c, teamSize: val }));
if (val === '1-5') updateScores({ hubspot: 3, pipedrive: 4, zoho: 3, monday: 4, freshsales: 3 });
else if (val === '6-20') updateScores({ hubspot: 4, pipedrive: 3, zoho: 4, monday: 3, freshsales: 4 });
else if (val === '21-50') updateScores({ hubspot: 3, salesforce: 3, pipedrive: 2, zoho: 4, monday: 2 });
else if (val === '51-200') updateScores({ salesforce: 5, zoho: 3, hubspot: 2 });
else updateScores({ salesforce: 5 });
}
});
});
page1.addRow(row => {
row.addRadioButton('industry', {
label: 'What industry are you in?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'saas', name: '💻 SaaS / Technology' },
{ id: 'services', name: '💼 Professional Services' },
{ id: 'ecommerce', name: '🛒 E-commerce / Retail' },
{ id: 'manufacturing', name: '🏭 Manufacturing' },
{ id: 'realestate', name: '🏠 Real Estate' },
{ id: 'other', name: '📦 Other' }
],
onValueChange: (val) => {
if (!val) return;
preferences.update(c => ({ ...c, industry: val }));
if (val === 'saas') updateScores({ hubspot: 4, pipedrive: 3, freshsales: 3 });
else if (val === 'services') updateScores({ pipedrive: 3, zoho: 3, hubspot: 2 });
else if (val === 'ecommerce') updateScores({ hubspot: 4, zoho: 3 });
else if (val === 'manufacturing') updateScores({ salesforce: 4, zoho: 3 });
else if (val === 'realestate') updateScores({ pipedrive: 4, zoho: 3, freshsales: 3 });
}
});
});
// ============ PAGE 2: Budget & Priorities ============
const page2 = pages.addPage('budget', { mobileBreakpoint: 500 });
page2.addRow(row => {
row.addTextPanel('header2', {
label: 'Step 2 of 6: Budget & Priorities',
computedValue: () => 'What matters most to you?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page2.addSpacer({ height: '24px' });
page2.addRow(row => {
row.addRadioButton('budget', {
label: 'What\'s your CRM budget per user/month?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'free', name: '🆓 Free or minimal ($0-15/user)' },
{ id: 'low', name: '💵 Budget-friendly ($15-30/user)' },
{ id: 'mid', name: '💰 Mid-range ($30-75/user)' },
{ id: 'high', name: '💎 Premium ($75-150/user)' },
{ id: 'enterprise', name: '🏆 Enterprise ($150+/user)' }
],
onValueChange: (val) => {
if (!val) return;
preferences.update(c => ({ ...c, budget: val }));
if (val === 'free') updateScores({ hubspot: 5, zoho: 4, freshsales: 3 });
else if (val === 'low') updateScores({ zoho: 4, pipedrive: 4, monday: 3, freshsales: 3 });
else if (val === 'mid') updateScores({ hubspot: 3, pipedrive: 3, zoho: 3, freshsales: 3 });
else if (val === 'high') updateScores({ hubspot: 3, salesforce: 3 });
else updateScores({ salesforce: 5, hubspot: 2 });
}
});
});
page2.addRow(row => {
row.addSuggestionChips('priorities', {
label: 'What are your top priorities? (Select up to 3)',
isRequired: true,
suggestions: [
{ id: 'ease', name: 'Ease of use' },
{ id: 'automation', name: 'Automation' },
{ id: 'reporting', name: 'Reporting' },
{ id: 'marketing', name: 'Marketing' },
{ id: 'customization', name: 'Customization' },
{ id: 'integrations', name: 'Integrations' },
{ id: 'mobile', name: 'Mobile App' },
{ id: 'support', name: 'Support' }
],
max: 3,
min: 1,
alignment: 'left',
onValueChange: (val) => {
preferences.update(c => ({ ...c, priorities: val as string[] }));
const vals = val as string[];
if (vals.includes('ease')) updateScores({ pipedrive: 4, monday: 4, hubspot: 3 });
if (vals.includes('automation')) updateScores({ hubspot: 4, salesforce: 4, zoho: 3 });
if (vals.includes('reporting')) updateScores({ salesforce: 5, hubspot: 3, zoho: 3 });
if (vals.includes('marketing')) updateScores({ hubspot: 5, zoho: 2 });
if (vals.includes('customization')) updateScores({ salesforce: 5, zoho: 4 });
if (vals.includes('integrations')) updateScores({ hubspot: 4, salesforce: 4, zoho: 3 });
if (vals.includes('mobile')) updateScores({ pipedrive: 4, hubspot: 3, freshsales: 3 });
if (vals.includes('support')) updateScores({ hubspot: 3, salesforce: 3 });
}
});
});
// ============ PAGE 3: Technical Requirements ============
const page3 = pages.addPage('technical', { mobileBreakpoint: 500 });
page3.addRow(row => {
row.addTextPanel('header3', {
label: 'Step 3 of 6: Technical Needs',
computedValue: () => 'What\'s your technical situation?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page3.addSpacer({ height: '24px' });
page3.addRow(row => {
row.addEmojiRating('techLevel', {
label: 'What\'s your team\'s technical expertise?',
isRequired: true,
preset: 'effort',
size: 'lg',
showLabels: true,
alignment: 'center',
onValueChange: (val) => {
if (!val) return;
preferences.update(c => ({ ...c, techLevel: val }));
// very-hard/hard = beginner, neutral = intermediate, easy/very-easy = advanced
if (val === 'very-hard' || val === 'hard') updateScores({ pipedrive: 4, monday: 4, hubspot: 3, freshsales: 3 });
else if (val === 'neutral') updateScores({ hubspot: 3, zoho: 3, pipedrive: 2 });
else updateScores({ salesforce: 5, zoho: 3 });
}
});
});
page3.addRow(row => {
row.addTextPanel('techLevelHint', {
computedValue: () => {
const level = page3.emojiRating('techLevel')?.value();
if (level === 'very-hard' || level === 'hard') return 'We\'ll recommend simple, easy-to-use CRMs';
if (level === 'neutral') return 'We\'ll recommend balanced options with moderate complexity';
if (level === 'easy' || level === 'very-easy') return 'We\'ll include powerful, customizable CRMs';
return '';
},
customStyles: {
fontSize: '0.85rem',
color: '#6b7280',
textAlign: 'center',
marginTop: '0.5rem'
}
});
});
page3.addRow(row => {
row.addSuggestionChips('integrations', {
label: 'What tools do you need to integrate with?',
isRequired: true,
suggestions: [
{ id: 'email', name: 'Email' },
{ id: 'calendar', name: 'Calendar' },
{ id: 'slack', name: 'Slack/Teams' },
{ id: 'accounting', name: 'Accounting' },
{ id: 'marketing', name: 'Marketing' },
{ id: 'ecommerce', name: 'E-commerce' },
{ id: 'custom', name: 'Custom/API' }
],
min: 1,
alignment: 'left',
onValueChange: (val) => {
preferences.update(c => ({ ...c, integrations: val as string[] }));
const vals = val as string[];
if (vals.includes('marketing')) updateScores({ hubspot: 5, zoho: 2 });
if (vals.includes('ecommerce')) updateScores({ hubspot: 4, zoho: 3 });
if (vals.includes('custom')) updateScores({ salesforce: 4, hubspot: 3 });
if (vals.includes('accounting')) updateScores({ zoho: 4, pipedrive: 3 });
}
});
});
// ============ PAGE 4: Features ============
const page4 = pages.addPage('features', { mobileBreakpoint: 500 });
page4.addRow(row => {
row.addTextPanel('header4', {
label: 'Step 4 of 6: Must-Have Features',
computedValue: () => 'Which features are essential for you?',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page4.addSpacer({ height: '24px' });
page4.addRow(row => {
row.addRadioButton('salesProcess', {
label: 'How complex is your sales process?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'simple', name: '📋 Simple - Few stages, quick sales cycle' },
{ id: 'moderate', name: '📊 Moderate - Multiple stages, some complexity' },
{ id: 'complex', name: '🔄 Complex - Many stages, long cycle, multiple stakeholders' }
],
onValueChange: (val) => {
if (val === 'simple') updateScores({ pipedrive: 4, monday: 3, freshsales: 3 });
else if (val === 'moderate') updateScores({ hubspot: 4, zoho: 3, pipedrive: 2 });
else updateScores({ salesforce: 5, hubspot: 3 });
}
});
});
page4.addRow(row => {
row.addRadioButton('communication', {
label: 'What\'s your primary customer communication channel?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'email', name: '📧 Email - Most communication via email' },
{ id: 'phone', name: '📞 Phone - Lots of calls and follow-ups' },
{ id: 'mixed', name: '🔀 Mixed - Email, phone, chat, social' },
{ id: 'inperson', name: '🤝 In-person - Meetings and demos' }
],
onValueChange: (val) => {
if (val === 'email') updateScores({ hubspot: 4, zoho: 3 });
else if (val === 'phone') updateScores({ freshsales: 4, pipedrive: 3 });
else if (val === 'mixed') updateScores({ hubspot: 4, salesforce: 3, zoho: 3 });
else updateScores({ pipedrive: 3, salesforce: 3 });
}
});
});
page4.addRow(row => {
row.addRadioButton('timeline', {
label: 'When do you need to implement the CRM?',
isRequired: true,
orientation: 'vertical',
options: [
{ id: 'asap', name: '🚀 ASAP - Need to be up and running quickly' },
{ id: '1-3months', name: '📅 1-3 months - Some time to evaluate and set up' },
{ id: '3-6months', name: '🗓️ 3-6 months - Planning ahead, thorough evaluation' },
{ id: 'exploring', name: '🔍 Just exploring - No immediate timeline' }
],
onValueChange: (val) => {
if (val === 'asap') updateScores({ pipedrive: 4, monday: 4, hubspot: 3 });
else if (val === '3-6months') updateScores({ salesforce: 3 });
}
});
});
// ============ PAGE 5: Results ============
const page5 = pages.addPage('results', { mobileBreakpoint: 500 });
page5.addRow(row => {
row.addTextPanel('header5', {
label: 'Step 5 of 6: Your CRM Recommendations',
computedValue: () => 'Based on your answers, here are your best matches',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page5.addSpacer({ height: '24px' });
page5.addRow(row => {
row.addTextPanel('topMatch', {
computedValue: () => {
const top = getTopCRM();
return `${crmDatabase[top].logo} #1 Match: ${crmDatabase[top].name}`;
},
customStyles: {
fontSize: '1.5rem',
fontWeight: '800',
textAlign: 'center',
color: '#059669',
padding: '20px',
background: '#ecfdf5',
borderRadius: '12px',
border: '3px solid #059669'
}
});
});
page5.addRow(row => {
row.addTextPanel('topTagline', {
computedValue: () => crmDatabase[getTopCRM()].tagline,
customStyles: {
fontSize: '1rem',
color: '#4b5563',
textAlign: 'center',
marginTop: '0.5rem'
}
});
});
page5.addRow(row => {
row.addTextPanel('topBestFor', {
computedValue: () => `Best for: ${crmDatabase[getTopCRM()].bestFor}`,
customStyles: {
fontSize: '0.95rem',
color: '#059669',
textAlign: 'center',
fontWeight: '500',
marginTop: '0.5rem'
}
});
});
page5.addRow(row => {
row.addTextPanel('topPrice', {
computedValue: () => `💰 Price: ${crmDatabase[getTopCRM()].priceRange}`,
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
textAlign: 'center',
marginTop: '0.5rem'
}
});
});
page5.addSpacer({ height: '15px' });
page5.addRow(row => {
row.addTextPanel('strengthsTitle', {
label: '✅ Key Strengths',
computedValue: () => crmDatabase[getTopCRM()].strengths.join(' • '),
customStyles: {
fontSize: '0.9rem',
color: '#059669',
padding: '12px',
background: '#f0fdf4',
borderRadius: '8px'
}
});
});
page5.addRow(row => {
row.addTextPanel('considerationsTitle', {
label: '⚠️ Considerations',
computedValue: () => crmDatabase[getTopCRM()].considerations.join(' • '),
customStyles: {
fontSize: '0.9rem',
color: '#d97706',
padding: '12px',
background: '#fffbeb',
borderRadius: '8px',
marginTop: '0.5rem'
}
});
});
page5.addSpacer({ height: '15px' });
page5.addRow(row => {
row.addTextPanel('runnersUp', {
label: '🥈 Also Consider',
computedValue: () => {
const tops = getTopCRMs();
if (tops.length > 1) {
const second = tops[1] || 'pipedrive';
const third = tops[2] || 'zoho';
return `${crmDatabase[second].logo} ${crmDatabase[second].name} • ${crmDatabase[third].logo} ${crmDatabase[third].name}`;
}
return '';
},
customStyles: {
fontSize: '0.95rem',
color: '#6b7280',
padding: '12px',
background: '#f3f4f6',
borderRadius: '8px'
}
});
});
// ============ PAGE 6: Lead Capture ============
const page6 = pages.addPage('lead-capture', { mobileBreakpoint: 500 });
page6.addRow(row => {
row.addTextPanel('header6', {
label: 'Step 6 of 6: Get Your Report',
computedValue: () => 'Enter your details to receive your personalized CRM comparison',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280',
marginBottom: '1rem'
}
});
});
page6.addSpacer({ height: '24px' });
page6.addRow(row => {
row.addTextPanel('leadCapture', {
label: '📧 Get Your Full CRM Comparison Report',
computedValue: () => 'Enter your details to receive a detailed PDF comparing your top matches',
customStyles: {
fontSize: '0.9rem',
color: '#6b7280'
}
});
});
page6.addRow(row => {
row.addTextbox('name', {
label: 'Your Name',
isRequired: true,
placeholder: 'John Smith'
}, '1fr');
row.addEmail('email', {
label: 'Work Email',
isRequired: true,
placeholder: 'john@company.com'
}, '1fr');
});
page6.addRow(row => {
row.addTextbox('company', {
label: 'Company Name',
placeholder: 'Acme Inc.'
}, '1fr');
row.addTextbox('phone', {
label: 'Phone (optional)',
placeholder: '+1 (555) 123-4567'
}, '1fr');
});
page6.addRow(row => {
row.addCheckboxList('consent', {
options: [
{ id: 'report', name: '📄 Send me the detailed CRM comparison report', isRequired: true },
{ id: 'demo', name: '🎥 I\'d like a demo of my top CRM match' },
{ id: 'newsletter', name: '📰 Send me CRM tips and best practices' }
],
defaultValue: ['report'],
orientation: 'vertical'
});
});
// ============ PDF REPORT ============
form.configurePdf('crm-report', pdf => {
pdf.configure({
filename: 'crm-comparison-report.pdf',
pageSize: 'A4',
allowUserDownload: true,
downloadButtonLabel: '📄 Download CRM Report',
header: {
title: 'CRM Comparison Report',
subtitle: 'Your Personalized Recommendations'
},
footer: {
text: 'Generated by FormTs CRM Finder',
showPageNumbers: true
}
});
const tops = getTopCRMs();
pdf.addSection('Your #1 Match', section => {
const top = tops[0] || 'hubspot';
section.addRow(row => {
row.addField('CRM', `${crmDatabase[top].logo} ${crmDatabase[top].name}`);
row.addField('Price Range', crmDatabase[top].priceRange);
});
section.addText(crmDatabase[top].tagline);
section.addSpacer(10);
section.addRow(row => {
row.addField('Best For', crmDatabase[top].bestFor);
});
section.addRow(row => {
row.addField('Key Strengths', crmDatabase[top].strengths.join(', '));
});
section.addRow(row => {
row.addField('Considerations', crmDatabase[top].considerations.join(', '));
});
});
if (tops.length > 1) {
pdf.addSection('Alternative Options', section => {
for (let i = 1; i < tops.length; i++) {
const crm = tops[i] || 'pipedrive';
section.addRow(row => {
row.addField(`#${i + 1}`, `${crmDatabase[crm].logo} ${crmDatabase[crm].name}`);
row.addField('Price', crmDatabase[crm].priceRange);
});
section.addRow(row => {
row.addField('Best For', crmDatabase[crm].bestFor);
});
section.addSpacer(10);
}
});
}
pdf.addPageBreak();
pdf.addSection('Your Requirements Summary', section => {
const p = preferences();
section.addRow(row => {
row.addField('Team Size', p.teamSize || 'Not specified');
row.addField('Budget', p.budget || 'Not specified');
});
section.addRow(row => {
row.addField('Industry', p.industry || 'Not specified');
row.addField('Tech Level', p.techLevel || 'Not specified');
});
section.addRow(row => {
row.addField('Top Priorities', p.priorities.join(', ') || 'Not specified');
});
});
pdf.addSection('Next Steps', section => {
section.addText('1. Sign up for free trials of your top 2-3 matches');
section.addText('2. Import a sample of your data to test workflows');
section.addText('3. Have your team test for 1-2 weeks each');
section.addText('4. Compare based on ease of use and feature fit');
section.addText('5. Negotiate pricing before committing annually');
});
pdf.addSection('CRM Selection Tips', section => {
section.addText('• Don\'t overbuy - start with what you need now');
section.addText('• Prioritize adoption - the best CRM is one your team uses');
section.addText('• Plan for growth - ensure upgrade paths exist');
section.addText('• Check integrations - verify connections to your tools');
section.addText('• Factor in training - budget time for onboarding');
});
});
// ============ SUBMIT BUTTON ============
form.configureSubmitButton({
label: () => `🎯 Get My ${crmDatabase[getTopCRM()].name} Report`
});
form.configureSubmitBehavior({
sendToServer: true
});
}