All Apps and Add-ons

Table Module "per row" checkbox module downstreams

alvaromari83
Path Finder

Hello everyone!

I'm using advance xml and sideview utils to implement some pretty panels. One of them renders a Table, with some results, including a placeholder field (named for example "PLACEHOLDER") to render Checkbox modules in the results table, one per row. As you know you can do this with something like:

<module name="Table">
 <module name="Checkbox" group="$row.field.PLACEHOLDER$">
   <param name="name">row_selection</param>
   <param name="onValue">$row.field.Data_Field$</param>
 </module>
</module>

This will render a table with checkboxes in every row, and when you check the box in the i-row, the i-value in the field "Data_Field" in the table will be go downstream. From here, you can use it, teleport it, etc.

My problem is i want to make MULTIPLE selections. This is, I want to get all the Data_Field values from all the rows where the checkbox is selected. For example, if Data_Field values is A for row 1, B for row 2 and C for row 3, if I check the boxes in rows 1 and 3, I want to get BOTH A and C values as the downstreamed data. But, instead, it just downstreams the data from latest row checked.

The only workaround I've reached is to create a temporal variable in a csv, with an array or vector of values. When a checkbox is selected, it executes a search like

| inputcsv temp.csv | eval selection=selection."$row.field.Data_Field$," | outputcsv temp.csv 

and when the box is unchecked:

| inputcsv temp.csv | eval selection=replace(selection,"$row.field.Data_Field$,","") | outputcsv temp.csv 

Pretty ugly, so not using it at all.

Is there any way to acomplish multiple row data downstream from modules inside Table module rows?

Thanks!!

1 Solution

sideview
SplunkTrust
SplunkTrust

OOh. good question. No, not today. At least not without writing a bit of custom code. And it's not custom code you really want to try writing.

As to the future, whether the Table module could gain this (very cool) ability.... the short answer is "ow".
Even with some clever changes I might think of and implement, this is a place where even the heroic Table Embedding feature should probably not tread. It may be better to implement this with a CheckboxTable or SelectableTable module. (Such a distinction is definitely the more normal path taken by other modular UI frameworks I've seen).

However I then wrote out a couple headache-inducing explanations of why this is a hard thing, but they're not entirely convincing so I've omitted them here. It's possible that this can be done and I'll look into it further.

View solution in original post

0 Karma

sideview
SplunkTrust
SplunkTrust

OOh. good question. No, not today. At least not without writing a bit of custom code. And it's not custom code you really want to try writing.

As to the future, whether the Table module could gain this (very cool) ability.... the short answer is "ow".
Even with some clever changes I might think of and implement, this is a place where even the heroic Table Embedding feature should probably not tread. It may be better to implement this with a CheckboxTable or SelectableTable module. (Such a distinction is definitely the more normal path taken by other modular UI frameworks I've seen).

However I then wrote out a couple headache-inducing explanations of why this is a hard thing, but they're not entirely convincing so I've omitted them here. It's possible that this can be done and I'll look into it further.

0 Karma

yogushelly
Explorer

Can you share the source code , if this requirement is already acheived

0 Karma

alvaromari83
Path Finder

Yep! Good to know, thank you for the answer and for your neat app!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...