Connect Shopify to Folk CRM Using Zapier
Shopify New Order → Create / Update Folk CRM
You can automatically create or update customer contacts in Folk whenever a new order is placed in Shopify, using Zapier.
1. Connect Your Accounts
Authenticate your Shopify account to trigger on "New Order" events
Connect your Folk account so Zapier can create/update contacts and deals automatically
2. Configure the Automation
The automation will:
Step 1: Trigger when a new order is placed in Shopify
Step 2: Format order data using custom code with these inputs:
items_purchase
: Product items from the orderformat_date_valid
: Order creation dateshopify_tags
: Tags associated with the order
Step 3: Find if the customer already exists in Folk using their email
Step 4: Split into two paths based on whether customer exists
Step 5/8: Path conditions determine next action
Step 6: Update existing person (if found)
Step 9: Create new person (if not found)
Step 7/10: Create deal/order record linked to the customer
3. Code by Zapier “Format Shopify/Folk” (Step 2)
The automation includes custom JavaScript code that transforms Shopify data into Folk-compatible formats:
Purpose: Converts raw Shopify data (items, dates, tags) into clean arrays and proper formats that Folk CRM can understand. In Input Date
, you have to enter this with Shopify data.
And in Code
you can direclty paste :
// Code by Zapier - Formatting for Folk CRM// Input Data mapped: items_purchase, format_date_valid, shopify_tags// 1. LINE ITEMS FORMATTING
let formattedItems = [];
let itemsForJson = '';
if (inputData.items_purchase) {
// If it's a string
if (typeof inputData.items_purchase === 'string') {
formattedItems = inputData.items_purchase
.split(',')
.map(item => item.trim())
.filter(item => item.length > 0); // Remove empty elements
}
// If it's an array - always take the first element and split by comma
else if (Array.isArray(inputData.items_purchase) && inputData.items_purchase.length > 0) {
formattedItems = inputData.items_purchase[0]
.split(',')
.map(item => item.trim())
.filter(item => item.length > 0);
}
// Format for JSON output
if (formattedItems.length > 0) {
itemsForJson = formattedItems.map(item => `"${item}"`).join(', ');
}
}
// 2. DATE FORMATTING
let formattedDate = '';
if (inputData.format_date_valid) {
try {
let date = new Date(inputData.format_date_valid);
// YYYY-MM-DD formatting
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
formattedDate = `${year}-${month}-${day}`;
} catch (error) {
console.log('Date formatting error:', error);
formattedDate = inputData.format_date_valid; // Fallback
}
}
// 3. SHOPIFY TAGS FORMATTING
let formattedTags = [];
if (inputData.shopify_tags) {
// If it's a comma-separated string
if (typeof inputData.shopify_tags === 'string') {
formattedTags = inputData.shopify_tags
.split(',')
.map(tag => tag.trim())
.filter(tag => tag.length > 0 && tag !== ' ');
}
// If it's already an array
else if (Array.isArray(inputData.shopify_tags)) {
formattedTags = inputData.shopify_tags
.filter(tag => tag && tag.trim().length > 0 && tag.trim() !== ' ');
}
}
// Format tags with quotes for JSON
let tagsForJson = '';
if (formattedTags.length > 0) {
// Create a string with tags in quotes, separated by commas
tagsForJson = formattedTags.map(tag => `"${tag}"`).join(', ');
} else {
// If empty, put nothing (so [] stays empty)
tagsForJson = '';
}
// 4. EMPTY CASES HANDLING & RETURN
return {
// Line items formatted for JSON string
items_for_json: itemsForJson,
// Date formatted YYYY-MM-DD
created_at_formatted: formattedDate,
// Tags formatted as array
shopify_tags_formatted: tagsForJson,
// Debug info
items_count: formattedItems.length,
tags_count: formattedTags.length
};
What it does:
Line Items: Converts comma-separated product names into JSON-ready format
Dates: Transforms any date format into YYYY-MM-DD standard
Tags: Processes Shopify tags into JSON format with proper quotes
Error Handling: Provides fallbacks for empty or invalid data
4. Path Logic (Steps 4-5-8)
After finding a person in Folk, the automation splits into two conditional paths:
Path A - When Folk ID Exists:
Only continue if: 3. id → Exists
Condition: Customer found in Folk CRM
Action: Update existing person record (Step 6)
Result: Maintains existing customer data while updating with new order info
Path B - When Folk ID Does Not Exist:
Only continue if: 3. id → Does not exist
Condition: Customer not found in Folk CRM
Action: Create new person record (Step 9)
Result: Adds new customer to Folk with complete Shopify data
Both paths converge to create a deal record linked to the customer (Steps 7 & 10).
5. Deal Creation Webhook (Steps 7 & 10)
You need to place a “Zapier Webhook” and in “Event” select “Custom Request”.
After you need to go to “Configure” and in method select : “POST”.
For the URL put : [https://api.folk.app/v1/groups/](<https://api.folk.app/v1/groups/>){{groupId}}/{{EntityName}}
Data Pass-Trought? : “False”
And in the data
field, you can paste this JSON (and customize it for your Folk CRM) :
{
"name": "{{customer_firstName}} {{customer_lastName}} - {{order_name}}",
"people": [
{
"id": "per_{{folk_person_id}}"
}
],
"customFieldValues": {
"Email": "{{customer_email}}",
"Associated Line Items": [{{items_for_json}}],
"Sales Funnel Status": "Order Placed",
"Shopify Payment Status": "{{displayFinancialStatus}}",
"Fulfillment Status": "{{displayFulfillmentStatus}}",
"Subtotal": {{subtotal_amount}},
"Total": {{total_amount}},
"Created at": "{{created_at_formatted}}",
"Name": "{{customer_firstName}} {{customer_lastName}}",
"Address": "{{shipping_address}}",
"City": "{{shipping_city}}",
"State/Region": "{{billing_provinceCode}}",
"Country/Region": "{{shipping_country}}",
"Zip Code": "{{shipping_zip}}",
"Notes": "{{customer_note}}",
"Shopify Tags": [{{shopify_tags_formatted}}]
}
}
6. Optional: Customize Fields
Modify the custom code to format additional Shopify fields
Add custom Folk fields to capture specific business data
Apply filters to process only certain types of orders (e.g., orders over a certain amount)
Customize the deal naming convention or add specific tags
What Data Gets Synced:
Customer Information:
Name, email, phone
Billing and shipping addresses
Customer notes from Shopify
Order Details:
Order name and number
Line items purchased
Payment and fulfillment status
Subtotal and total amounts
Order creation date
Associated Shopify tags
This automation ensures your Folk CRM stays automatically updated with every Shopify sale, eliminating manual data entry and maintaining complete customer records.
Shopify Update Order → Update Folk CRM
You can automatically update customer contacts and deals in Folk whenever an order is updated in Shopify, using Zapier.
How to Set It Up:
1. Connect Your Accounts
Authenticate your Shopify account to trigger on "Updated Order" events
Connect your Folk account so Zapier can update contacts and deals automatically
2. Configure the Automation
The automation will:
Step 1: Trigger when an order is updated in Shopify
Step 2: Find the customer in Folk using their email address
Step 3: Get the customer's detailed information via Folk API using GET request to:
https://api.folk.app/v1/people/per_{ID}
Step 4: Format the updated order data using custom code with these inputs:
items_purchase
: Product items from the orderformat_date_valid
: Order update dateshopify_tags
: Tags associated with the order
Step 5: Update the customer's contact information in Folk
Step 6: Modify the specific deal with new order status
3. Code by Zapier “Format Shopify/Folk” (Step 4)
The automation includes custom JavaScript code that transforms Shopify data into Folk-compatible formats:
Purpose: Converts raw Shopify data (items, dates, tags) into clean arrays and proper formats that Folk CRM can understand.
// Code by Zapier - Formatting for Folk CRM// Input Data mapped: items_purchase, format_date_valid, shopify_tags// 1. LINE ITEMS FORMATTING
let formattedItems = [];
if (inputData.items_purchase) {
// If it's a comma-separated string
if (typeof inputData.items_purchase === 'string') {
formattedItems = inputData.items_purchase
.split(',')
.map(item => item.trim())
.filter(item => item.length > 0); // Remove empty elements
}
// If it's already an array
else if (Array.isArray(inputData.items_purchase)) {
formattedItems = inputData.items_purchase.filter(item => item && item.length > 0);
}
}
// 2. DATE FORMATTING
let formattedDate = '';
if (inputData.format_date_valid) {
try {
let date = new Date(inputData.format_date_valid);
// YYYY-MM-DD formatting
let year = date.getFullYear();
let month = (date.getMonth() + 1).toString().padStart(2, '0');
let day = date.getDate().toString().padStart(2, '0');
formattedDate = `${year}-${month}-${day}`;
} catch (error) {
console.log('Date formatting error:', error);
formattedDate = inputData.format_date_valid; // Fallback
}
}
// 3. SHOPIFY TAGS FORMATTING
let formattedTags = [];
if (inputData.shopify_tags) {
// If it's a comma-separated string
if (typeof inputData.shopify_tags === 'string') {
formattedTags = inputData.shopify_tags
.split(',')
.map(tag => tag.trim())
.filter(tag => tag.length > 0 && tag !== ' ');
}
// If it's already an array
else if (Array.isArray(inputData.shopify_tags)) {
formattedTags = inputData.shopify_tags
.filter(tag => tag && tag.trim().length > 0 && tag.trim() !== ' ');
}
}
// Format tags with quotes for JSON
let tagsForJson = '';
if (formattedTags.length > 0) {
// Create a string with tags in quotes, separated by commas
tagsForJson = formattedTags.map(tag => `"${tag}"`).join(', ');
} else {
// If empty, put nothing (so [] stays empty)
tagsForJson = '';
}
// 4. EMPTY CASES HANDLING// If no line items, empty array
if (formattedItems.length === 0) {
formattedItems = [];
}
// If no tags, empty array
if (formattedTags.length === 0) {
formattedTags = [];
}
// If no date, use current date
if (!formattedDate) {
let today = new Date();
let year = today.getFullYear();
let month = (today.getMonth() + 1).toString().padStart(2, '0');
let day = today.getDate().toString().padStart(2, '0');
formattedDate = `${year}-${month}-${day}`;
}
// 5. FORMATTED DATA RETURN
return {
// Line items formatted as array
associated_line_items: formattedItems,
// Date formatted YYYY-MM-DD
created_at_formatted: formattedDate,
// Tags formatted as array
shopify_tags_formatted: tagsForJson,
// Debug info
items_count: formattedItems.length,
tags_count: formattedTags.length,
original_items: inputData.items_purchase,
original_tags: inputData.shopify_tags,
original_date: inputData.format_date_valid
};
What it does:
Line Items: Converts comma-separated product names into clean arrays
Dates: Transforms any date format into YYYY-MM-DD standard
Tags: Processes Shopify tags into JSON-ready format with proper quotes
Error Handling: Provides fallbacks for empty or invalid data
4. Deal Modification Webhook (Step 6)
Place a “Zapier Webhook” and in “Event” select “Custom Request”.
Then go to “Configure” and in “Method” select PATCH
For the “URL” : https://api.folk.app/v1/groups/{groupId}/{entityType}/{dealId}
“Data Pass Throught” select False After that, you can put this JSON into the data
field (and customize it for your own Folk CRM):
{
"name": "{{customer_name}} - {{order_name}}",
"people": [
{
"id": "per_{{folk_person_id}}"
}
],
"customFieldValues": {
"Email": "{{customer_email}}",
"Sales Funnel Status": "Order Updated",
"Shopify Payment Status": "{{payment_status}}",
"Fulfillment Status": "{{fulfillment_status}}",
"Address": "{{shipping_address}}",
"City": "{{shipping_city}}",
"State/Region": "{{billing_province}}",
"Country/Region": "{{shipping_country}}",
"Zip Code": "{{shipping_zip}}",
"Notes": "{{customer_notes}}"
}
}
5. Optional: Customize Updates
Modify the custom code to format additional Shopify update fields
Add filters to process only specific types of order updates (e.g., payment status changes)
Customize which Folk fields get updated based on the type of Shopify change
Set conditions to update deals only for certain order statuses
What Data Gets Updated:
Deal Information:
Sales funnel status changed to "Order Updated"
Current payment and fulfillment status
Updated shipping and billing addresses
Customer notes and contact details
Customer Contact:
Updated contact information from Shopify
Refreshed order history and status
This automation ensures your Folk CRM stays synchronized with any changes to Shopify orders, keeping your customer data accurate and up-to-date automatically.