Jump to content

Script to highlight rows when Date value is already present (vlookup).


Recommended Posts

Hi, 

I would like to ask help to you as I would like to have a scritp to add onto Footer in order to highlight the rows when the Date value already exist in the date/time column. 

I searched in the forum 3d, found this example but is os not what I exactely I am looking for.

Table contains Date column with DateType Date/Time as in attached example. 

Do you have any code suggest please?

Thanks in advance for your help. 

Capture001.PNG

Capture001.PNG

Link to comment
Share on other sites

Hello @Mirko,

If the goal is to highlight the row if the Date field is not empty as on this screenshot, you may check the code below

e4Dt0HE.png

 

<script>
    document.addEventListener('DataPageReady', colorHandler);

    function colorHandler() {

        const dateField = document.querySelectorAll('td:nth-child(5)'); //5 is the field order number on the result page

        dateField.forEach(element => {
           if (element.innerText.trim() !== '') {
                element.parentNode.style.backgroundColor = '#e4a889'; //apply your color code
            }       
        });

  document.removeEventListener('DataPageReady', colorHandler);
};
</script>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...