Hide a custom button depending the logged-in user type

Hello guys !
I would like to show or hide custom code buttons depending the type of user connected.
The type of user is an info from airtable that allows me to create the group users.

My custom code button does not work because it show both buttons and don’t take the group user into consideration…

Here the code :

Votre titre de page .floatingButton { position: fixed; font-size: 13px; font-family: 'Montserrat'; right: 0px; padding: 10px 10px; background-color: #77b122; color: #FFFFFF; border: none; border-top-left-radius: 0px; border-bottom-left-radius: 5px; cursor: pointer; transition: background-color 0.3s; outline: none; }
    #firstButton {
        top: 100px;
        display: none;

    #secondButton {
        top: 170px;
        display: none;

    .floatingButton:hover {
        background-color: #9bc659;
<button id="firstButton" class="floatingButton">Nouveaux dossiers 📁</button>
<button id="secondButton" class="floatingButton">Bouton MIOB 🌟</button>

    document.getElementById('firstButton').addEventListener('click', function() {
        window.location.href = "https://xxxxxxxxxxxx;

    document.getElementById('secondButton').addEventListener('click', function() {
        window.location.href = "https://votre-site-web.com/page-cible2";

    document.addEventListener("DOMContentLoaded", function() {
        if (window['logged_in_user'] && window['logged_in_user']['Rôle']) {
            const userGroup = window['logged_in_user']['Rôle'];

            if (userGroup === 'Apporteur') {
                document.getElementById('firstButton').style.display = "block";
                document.getElementById('secondButton').style.display = "none";
            } else if (userGroup === 'MIOB') {
                document.getElementById('firstButton').style.display = "none";
                document.getElementById('secondButton').style.display = "block";

Did anyone has used the custom button ? :))
A quick help woud be precious on that !!


Hi Agathe,
Following our discussion, I found the solution => back to No-code France thread.