š« Exclude duplicate bookings or inactive employees.
1. Overview
This Interaction enables you to filter out inactive sales representatives or employees. Additionally, it lets you filter out duplicate entries as well.
2. Examples
Refer to the examples below:
2.1. Example 1
In the example, the function displays all those sales representatives who are active, i.e., where the inactive checkbox is false, where the inactive checkbox is empty or where the general type of inactive sales representatives does not exist.
async function handler(clev) {
let actions = [];
actions.push(
clev.setFilters("sales-rep", [
{
subject: "inactive",
requestType: "i",
type: "checkbox",
operator: "is_false",
},
"OR",
{
subject: "inactive",
requestType: "i",
type: "checkbox",
operator: "is_empty",
},
"OR",
{
subject: "inactive",
requestType: "i",
type: "general",
operator: "not_exists",
},
])
);
return clev.mergeAll(actions);
}2.2. Example 2
This function returns the ordered by bookings with filtered-out duplicate guest entries. It checks for duplicates within the defined data and filters them out so that the result contains zero duplicate items.
async function handler(clev) {
let actions = [];
actions.push(
clev.setFilters("bookings-ordered-by", [
{
subject: "duplicate",
requestType: "i",
type: "checkbox",
operator: "is_false",
},
"OR",
{
subject: "duplicate",
requestType: "i",
type: "checkbox",
operator: "is_empty",
},
"OR",
{
subject: "duplicate",
requestType: "i",
type: "general",
operator: "not_exists",
},
])
);
return clev.mergeAll(actions);
}š Need Help?
