All Apps and Add-ons
Highlighted

Table Module "per row" checkbox module downstreams

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 DataField values from all the rows where the checkbox is selected. For example, if DataField 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!!

Highlighted

Re: Table Module "per row" checkbox module downstreams

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
Highlighted

Re: Table Module "per row" checkbox module downstreams

Path Finder

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

0 Karma
Highlighted

Re: Table Module "per row" checkbox module downstreams

Explorer

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

0 Karma