Tutorial: How to Bulk Delete CX Model Notifications

Christopher Ryan Expert (Gold)
  • Edited

CX Models don't natively support a way to bulk remove notifications, and any user of them knows how many get generated. Normally, you have to delete them one-by-one manually. Luckily, we can use some basic JavaScript to remove them one-by-one for us.

1) Open your CX Model in Google Chrome.

2) Click the notification bell in the top right

3) Press F12 to open Chrome Developer Tools and click the Console tab

4) Copy and paste the following code into the console (click to the right of the blue ">" you see in the screenshot above and paste this code in)

let iteration = 0;
const delay = 5000;
const notifications = 1000;

setInterval(() => {
            if (iteration < notifications) {
                iteration++;
                const ignore = document.querySelector("#select-dataset > tbody > tr > td:nth-child(4) > a:nth-child(3)");
                if (ignore) {
                    if (!ignore.hasAttribute('hidden')) {
                            ignore.click();
                        } else {
                            const warning = document.querySelector("#select-dataset > tbody > tr > td:nth-child(4) > a:nth-child(2)");
                            warning.click();
                        }
                    }
                }
                }, delay);

5) Press enter

6) Refresh the tab when all your notifications are gone.

0

Comments

0 comments

Please sign in to leave a comment.