• Instructions to Ask a Question

    Click on the "Ask a Question" button and select the application for which you would like to ask questions.

    We have 5 different products namely - Pabbly Connect, Pabbly Subscription Billing, Pabbly Email Marketing, Pabbly Form Builder, Pabbly Email Verification.

    The turnaround time is 24 hrs (Business Hours - 10.00 AM to 6.00 PM IST, Except Saturday and Sunday). So your kind patience will be highly appreciated!

    🚀🚀Exclusive Discount Offer

    Just in case you're looking for any ongoing offers on Pabbly, you can check the one-time offers listed below. You just need to pay once and use the application forever -
     

    🔥 Pabbly Connect One Time Plan for $249 (🏆Lifetime Access) -  View offer 

    🔥 Pabbly Subscription Billing One Time Plan for $249 (🏆Lifetime Access) - View offer

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