Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/07/2022 in all areas

  1. Hi everyone, I wish to share JavaScript that can help you to highlight some records based on the condition. First you need to do for that is to paste the code into the Header: <script> const backgroundColor = '#ff000094' const numberOfColumnForCondition = '5'; const condition = 'High'; document.addEventListener('DataPageReady', function(event) { let lines = document.querySelectorAll('tr[data-cb-name="data"]'); for (let line of lines) { if (line.querySelector('td:nth-child(' + numberOfColumnForCondition + ')').innerText == condition) { line.style.backgroundColor = backgroundColor; } } }) </script> Also you need to adjust first 3 lines of the code: 1) const backgroundColor = '#ff000094' This constant is used for setting the color of the background. 2) const numberOfColumnForCondition = '5'; The number 5 is the number of the column where we are going to check the condition. 3) const condition = 'High'; High is the value of our condition. So, in our example, we are going to highlight fields (rows) where the value in the 5th column equals 'High'.
    1 point
  2. Hello @peewee, You may check the list of supported functions in this article https://howto.caspio.com/function-reference/ Let me add more details about the FOR XML PATH clause for the future reference. For example, there is the table: 1) To display a comma-separated list of names: STUFF((SELECT ', ' + (EmployeeName) FROM EmployeeTable WHERE id > 1 ORDER BY EmployeeName FOR XML PATH ('')), 1, 1, '') The output: Ann, John, Tom 2) To display a list of names with line breaks: STUFF((SELECT CHAR(10) + (EmployeeName) FROM EmployeeTable WHERE id > 1 ORDER BY EmployeeName FOR XML PATH ('')), 1, 1, '') The output: Ann John Tom Note: WHERE clause, ORDER BY keyword are optional. Replace the field name and table name.
    1 point
×
×
  • Create New...