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
please let me know if pabbly has something similar?
my workflow id: https://connect.pabbly.com/workflow/mapping/IjU3NjUwNTY0MDYzNzA0MzY1MjZhNTUzYzUxMzAi_pc
thanks!
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: