Build a Deal-Ready Shared Space and MAP from CRM Data
A Shared Space built around a Mutual Action Plan (MAP) is most useful when the MAP reflects the actual deal: the buyer's stage, their key milestones, and the close date. That context already lives in your CRM.
How about if connecting the two was automatic? When a deal advances to a new stage in HubSpot or Salesforce, your pipeline pulls that context, sends it to your designated LLM, and creates a ready-to-send Shared Space with a draft MAP already inside. Milestones are populated from the deal data. The sales rep reviews and sends, instead of building from scratch.
Classic Situation
A sales team wants Mutual Action Plans created automatically from CRM data, not manually by reps during a busy deal cycle. Without automation:
- Copy-pasting milestones from a generic template that doesn't match the deal
- Forgetting to include key steps based on what the buyer said on the last call
- MAPs created late in the cycle because setup felt like overhead
- Inconsistent quality across the team
HubSpot Example
Pull CRM deal or opportunity data (stage, close date, stakeholders), send it to your designated LLM with a MAP generation prompt, and use the Showpad API to create the Shared Space and MAP with pre-populated milestones and actions.
- Plan: Ultimate with Enterprise add-on | Advanced or Expert
- Permissions: Administrator access to Showpad's Admin App
- Config:
- An LLM API key (examples below use the Anthropic API)
- An
ANTHROPIC_MODELenvironment variable set to the Claude model you want to use (see Claude models) - CRM API access (Salesforce, HubSpot, or similar)
- Familiarity with Shared Spaces and Mutual Action Plans
While this example uses HubSpot, you can adapt the CRM API calls to work with Salesforce, Microsoft Dynamics, or any CRM that exposes deal or opportunity data.
Steps
1. Fetch CRM Deal or Opportunity Data
Retrieve the deal context you need to make the MAP relevant. At minimum, grab the stage, expected close date, and key contacts. See the HubSpot CRM API | Deals guide for available properties.
async function getOpportunityContext(opportunityId, crmToken) {
const response = await fetch(
`https://api.hubspot.com/crm/v3/objects/deals/${opportunityId}?properties=dealname,dealstage,closedate,amount`,
{ headers: { Authorization: `Bearer ${crmToken}` } }
);
return response.json();
}
2. Generate MAP Structure with AI
Send the deal context to your designated LLM and ask it to produce a structured MAP plan with milestones and actions.
This step sends CRM deal data (deal name, stage, close date, value) to an external LLM provider. Ensure this is permitted under your organization's data handling policies and any agreements with your CRM and LLM vendors before using in production. CRM field values are interpolated directly into the prompt, so validate or sanitize them before use to prevent prompt injection.
import Anthropic from '@anthropic-ai/sdk';
const anthropic = new Anthropic();
async function generateMAPStructure(opportunity) {
const response = await anthropic.messages.create({
model: process.env.ANTHROPIC_MODEL, // Any current Claude model ID
max_tokens: 2048,
messages: [
{
role: 'user',
content: `You are a sales expert helping to create a Mutual Action Plan for an enterprise software deal.
Deal context:
- Name: ${opportunity.dealname}
- Stage: ${opportunity.dealstage}
- Target close date: ${opportunity.closedate}
- Deal value: ${opportunity.amount}
Create a MAP with 3 to 4 milestones that will guide this deal from the current stage to close. For each milestone, include 2 to 3 specific actions.
Return a JSON object in this exact format:
{
"milestones": [
{
"title": "string",
"actions": [
{ "title": "string", "dueOffsetDays": number }
]
}
]
}
Due offset days should be relative to today. The last action should be due on or before the target close date.`,
},
],
});
const text = response.content.find((block) => block.type === 'text').text;
return JSON.parse(text);
}
3. Create a Shared Space
MAPs live inside Shared Spaces. Create the space first, then attach the MAP.
async function createSharedSpace(dealName, showpadToken) {
const response = await fetch('https://{subdomain}.showpad.biz/api/v4/shared-spaces', {
method: 'POST',
headers: {
Authorization: `Bearer ${showpadToken}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ title: `${dealName}: Mutual Action Plan` }),
});
return response.json();
}
4. Create the MAP and Add Milestones
Use the Showpad API to create the plan, then add each milestone and its actions.
async function buildMAP(spaceId, mapStructure, showpadToken) {
const headers = {
Authorization: `Bearer ${showpadToken}`,
'Content-Type': 'application/json',
};
// Create the MAP
const mapResponse = await fetch(`https://{subdomain}.showpad.biz/api/v4/mutual-action-plan`, {
method: 'POST',
headers,
body: JSON.stringify({
contextType: 'SHARED-SPACE',
contextId: spaceId,
}),
});
const map = await mapResponse.json();
const mapId = map.id;
const today = new Date();
for (const milestone of mapStructure.milestones) {
// Create milestone
const msResponse = await fetch(`https://{subdomain}.showpad.biz/api/v4/mutual-action-plan/${mapId}/milestones`, {
method: 'POST',
headers,
body: JSON.stringify({ title: milestone.title }),
});
const ms = await msResponse.json();
const milestoneId = ms.id;
// Add actions to the milestone
for (const action of milestone.actions) {
const actionDueDate = new Date(today);
actionDueDate.setDate(actionDueDate.getDate() + action.dueOffsetDays);
await fetch(
`https://{subdomain}.showpad.biz/api/v4/mutual-action-plan/${mapId}/milestones/${milestoneId}/actions`,
{
method: 'POST',
headers,
body: JSON.stringify({
title: action.title,
dueAt: actionDueDate.toISOString(),
}),
}
);
}
}
return mapId;
}
5. Notify the Rep
Once the MAP is built, surface the Shared Space link to the rep so they can review, adjust, and invite the buyer.
async function generateMAPForDeal(opportunityId) {
const crmToken = process.env.CRM_API_TOKEN;
const showpadToken = process.env.SHOWPAD_API_TOKEN;
const opportunity = await getOpportunityContext(opportunityId, crmToken);
const mapStructure = await generateMAPStructure(opportunity.properties);
const space = await createSharedSpace(opportunity.properties.dealname, showpadToken);
const mapId = await buildMAP(space.id, mapStructure, showpadToken);
console.log(`MAP created for deal ${opportunityId}`);
console.log(`Shared Space: ${space.publicUrl}`);
// Send to rep via Slack, CRM task, or email
}
Give the rep a simple way to regenerate the MAP with a different tone or set of milestones. A "regenerate" button in your internal tooling that calls the LLM again with a revised prompt takes minutes to build and saves reps significant back-and-forth.
The Showpad API supports duplicating from a template. If you have an approved template in Showpad, consider starting with a duplicate and using AI to fill in the deal-specific actions rather than building from scratch. See MAP Templates for details.
Was this page helpful?