December 27, 2024
How to Automate a Divorce Preparedness Analysis and Notification System Using Dumpling AI and Make.com
This tutorial demonstrates how to create a workflow that evaluates responses from a Google Sheets form about divorce preparedness, processes them using Dumpling AI’s JavaScript function, and sends tailored email notifications based on the evaluation.
Step 1: Monitor Google Sheets for New Responses
Module: Google Sheets: Watch Rows
- Purpose: Triggers the workflow when new responses are added to the Google Sheets form.
- Configuration:
- Connection: Use your Google account.
- Spreadsheet: Select the target spreadsheet for divorce preparedness responses.
- Sheet Name: Choose the relevant sheet (e.g., Sheet1).
- Table Contains Headers: Set to Yes.
- Limit: Set to 1 to process one row per execution.
Context: This step ensures that each new response from the form triggers the automation.
Step 2: Process Responses Using Dumpling AI’s Run JavaScript Code
Module: Dumpling AI: Run JavaScript Code
- Purpose: Processes the form responses to count the number of “Yes” answers, which indicates the respondent’s level of preparedness for divorce.
- Code Explanation:
- Input: Maps responses from columns D to W (e.g., understanding of legal requirements, financial planning, and emotional readiness).
- Logic: Loops through the responses to count “Yes” answers dynamically.
- Output: Returns the count of “Yes” responses.
Sample Code:
// Simulate inputData (replace this with actual data passed from Google Sheets in Make.com)
const inputData = {
“1.3”: “{{1.`3`}}”,
“1.4”: “{{1.`4`}}”,
“1.5”: “{{1.`5`}}”,
“1.6”: “{{1.`6`}}”,
“1.7”: “{{1.`7`}}”,
“1.8”: “{{1.`8`}}”,
“1.9”: “{{1.`9`}}”,
“1.10”: “{{1.`10`}}”,
“1.11”: “{{1.`11`}}”,
“1.12”: “{{1.`12`}}”,
“1.13”: “{{1.`13`}}”,
“1.14”: “{{1.`14`}}”,
“1.15”: “{{1.`15`}}”,
“1.16”: “{{1.`16`}}”,
“1.17”: “{{1.`17`}}”,
“1.18”: “{{1.`18`}}”,
“1.19”: “{{1.`19`}}”,
“1.20”: “{{1.`20`}}”,
“1.21”: “{{1.`21`}}”,
“1.22”: “{{1.`22`}}”
};
// Retrieve responses dynamically from inputData
const responses = [];
// Extract variables from inputData
for (let i = 3; i <= 22; i++) {
const value = inputData[`1.${i}`];
responses.push(value); // Push all values for debugging
}
// Debugging: Log all extracted responses
console.log(“Extracted Responses:”, responses);
// Filter and count ‘Yes’ responses
const yesCount = responses.filter(response =>
typeof response === ‘string’ && response.trim().toLowerCase() === ‘yes’
).length;
// Debugging: Log the count of ‘Yes’ responses
console.log(“Count of ‘Yes’:”, yesCount);
// Assign the count as the output
yesCount;
Step 3: Route Based on Readiness Level
Module: Router
- Purpose: Splits the flow into three branches based on the number of “Yes” responses.
Branch 1: Fully Prepared (18 or More “Yes”)
- Filter Condition:
- {{get(split(3.logs.stdout[2]; “:”); 2)}} > 18
- Action:
- Send Email via Gmail:
- Subject: “Great News! You’re Prepared for a Smooth Divorce Transition.”
- Body: Congratulates the respondent on their readiness for the divorce process and provides reassurance.
- Send Email via Gmail:
Branch 2: Partially Prepared (12–17 “Yes”)
- Filter Condition:
- {{get(split(3.logs.stdout[2]; “:”); 2)}} > 12
- {{get(split(3.logs.stdout[2]; “:”); 2)}} < 18
- Action:
- Send Email via Gmail:
- Subject: “Important: Additional Preparation Needed for Divorce.”
- Body: Highlights areas where additional preparation is needed.
- Send Email via Gmail:
Branch 3: Not Prepared (Less than 11 “Yes”)
- Filter Condition:
- {{get(split(3.logs.stdout[2]; “:”); 2)}} < 11
- Action:
- Send Email via Gmail:
- Subject: “Ensuring Your Preparedness for a Critical Life Decision.”
- Body: Advises on steps to enhance preparedness and offers support resources.
- Send Email via Gmail:
Step 4: Final Testing and Activation
- Test the Automation:
- Submit sample responses via the Google Sheets form.
- Verify that responses trigger the correct branch and emails.
- Activate the Workflow:
- Once testing is successful, activate the scenario for real-time execution.
Conclusion
This automation streamlines the process of analyzing divorce preparedness, providing tailored recommendations and support to respondents based on their readiness level. By combining Google Sheets, Dumpling AI, and Make.com, you create a personalized, efficient system for handling sensitive topics like divorce planning.
Get the Blueprint Featured in This Guide
Access the full blueprint here to get started on setting up this automation effortlessly!