All Apps and Add-ons

Facing problem with Table module

theouhuios
Motivator

hello

I am trying to color up the rows based on the range they fall under and somehow I am not being able to do it. I guess my issue is with the css or with the rowClass param. Any idea on where I am doing a mistake?

    <module name="HTML" >
    <param name="html"><![CDATA[


<style type="text/css">
tr.haslow td {
  background-color:#506C23;
  color:white;
}
tr.hasmedium td {
  background-color:#86BA32;
  color:white;
}
tr.hassevere td  {
  background-color:#9BE91F;
  color:white;
}



</style>


    ]]></param>
  </module>
    <module name="Search" layoutPanel="panel_row1_col1" group="Internet team" autoRun="True">
        <param name="search">sourcetype="incident"| stats count by record.affectedCI | sort count | rangemap field=count low=0-1 medium=2-3 severe=4-5 </param>


                 <module name="JobProgressIndicator"></module>
    <module name="Pager">
        <param name="entityName">results</param>

        <module name="Table">
          <param name="name">"selectedUserRow"</param>
           <param name="hiddenFields">range</param>
          <param name="rowClass">has$row.fields.range$</param>
0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

I think the only problem is that you've set the "name" param to "selectedUserRow", away from its default of "row". Like all "name" params in Sideview Utils, this determines the name by which the $foo$ token is known downstream. In the case of the Table, and this might be a little confusing, the name param actually alters the $row.fields.range$ so that it should be $selectedUserRow.fields.range$.

I suggest using name params that don't actually have "selected" in them. Here I would simply call it "user", and thus the keys would be $user.fields.range$, etc...

Then downstream $user$ is implicitly the selected user, and in the internal feature foo of Table, $user$ returns to the particular row receiving the custom rendering or custom embedding.

View solution in original post

0 Karma

sideview
SplunkTrust
SplunkTrust

I think the only problem is that you've set the "name" param to "selectedUserRow", away from its default of "row". Like all "name" params in Sideview Utils, this determines the name by which the $foo$ token is known downstream. In the case of the Table, and this might be a little confusing, the name param actually alters the $row.fields.range$ so that it should be $selectedUserRow.fields.range$.

I suggest using name params that don't actually have "selected" in them. Here I would simply call it "user", and thus the keys would be $user.fields.range$, etc...

Then downstream $user$ is implicitly the selected user, and in the internal feature foo of Table, $user$ returns to the particular row receiving the custom rendering or custom embedding.

0 Karma

theouhuios
Motivator

Thanks for the help Nick. I changed the name param to row and it worked.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

Data Management Digest – May 2026

Welcome to the May 2026 edition of Data Management Digest!   As your trusted partner in data innovation, the ...