• Instructions to Ask a Question

    For any assistance, please click the "Ask a Question" button and select the Pabbly product for which you require support.

    We offer seven comprehensive applications designed to help you efficiently manage and grow your business:

    Our support team endeavors to respond within 24 business hours (Monday to Friday, 10:00 AM to 6:00 PM IST). We appreciate your understanding and patience.

    🚀 Exclusive Lifetime Offers 🚀

    We invite you to take advantage of our special one-time payment plans, providing lifetime access to select applications:

    • 🔥 Pabbly Connect — Lifetime Access for $249View Offer
    • 🔥 Pabbly Subscription Billing — Lifetime Access for $249View Offer

    Make a one-time investment and enjoy the advantages of robust business management tools for years to come.

Pabbly Deduplication Function

elonmusk

Member
hi, i'm currently using Salesforce Updated Record Trigger to send Whatsapp messages.

But i would like to trigger the flow ONCE only for specific Case Status, so that I dont send multiple identical messages to my clients.

is there any deduplication app/code that can be used with pabbly?

at zapier im using this code

JavaScript:
// **How to set up**
//
// Create two inputData fields: dedupeKey and storageKey
// Generate a unique UUID here: https://www.uuidgenerator.net/ and paste it into the storageKey field
// Use a new and unique storageKey for each deduper you set up as it will use the maximum capacity of a storage account
// Map the ID (or other unique value) from your Zap's Trigger into the dedupeKey field
// Add a Filter after this Code Step to only continue the Zap if 'previouslySeenValue' is false

const { dedupeKey, storageKey } = inputData;

const url = 'https://store.zapier.com/api/records';
const authHeaders = {
    'X-Secret': storageKey,
};

// Get all Values from Storage
const getOptions = {
    method: 'GET',
    headers: authHeaders
};
const getRes = await fetch(url, getOptions);
const getBody = await getRes.json();

// Check current dedupeKey against existing values, return 'previouslySeenValue:true' if there is a match, ending Code Step
const existingDedupeIDs = Object.values(getBody);
if (existingDedupeIDs.includes(dedupeKey)) {
    return { dedupeKey, previouslySeenValue: true, storedDedupeKeys: getBody};
}

// If there are 500 keys, prune 1 (Storage can only hold 500)
if (existingDedupeIDs.length > 499) existingDedupeIDs.shift();

// Add current dedupeKey as next key in the array
existingDedupeIDs.push(dedupeKey);

// Write keys back to Storage
const writeBody = {};
  existingDedupeIDs.forEach((dedupeKey, index) => {
  // we start at 100 for the key name so that all the names have
  // 3 characters and stay in the same sort order
  const keyName = `${index + 100}`;
  Object.assign(writeBody, { [keyName]: dedupeKey });
});

const postOptions = {
    method: 'POST',
    headers: authHeaders,
  body: JSON.stringify(writeBody),
};
const postRes = await fetch(url, postOptions);
const postBody = await postRes.json();

return { dedupeKey, previouslySeenValue: false, storedDedupeKeys: postBody };

please let me know if pabbly has something similar?
my workflow id: https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTY0MDYzNzA0MzY1MjZhNTUzYzUxMzAi_pc
thanks!
 
Last edited:

ArshilAhmad

Moderator
Staff member
I had a discussion with the technical team, and they informed me that currently, we don't have a built-in function to check for duplicate fields. However, you can try to achieve this use case by adding an application like Google Drive along with a filter condition to your workflow.

So let's suppose Record A is updated in your Salesforce account. A file with the same record name will be searched for in your Google Drive, and if it doesn't exist, the filter step will allow the next step to be executed, and a message will be sent. Additionally, a file with the name of this record update will be added to Google Drive. If the same record is updated again, it will be identified in step 2 of your workflow, and the workflow execution will stop at the filter step, thus preventing duplicate messages from being sent.

1721842270898.png
 
Top