All Apps and Add-ons

How to pass values from a multiselect dropdown through a Redirector module and prepopulate a dropdown on 2nd page

cmak
Contributor

With the following code:

<module name="Redirector">                                                                                                    <param name="url">VG_Single_DUT_Test_Data_v1</param>                                                                                                    <param name="popup">True</param>                                                                                                    <param name="arg.Weight_Select">$Weight_Select$</param>                                                                                                 <param name="windowFeatures">scrollbars=yes,width=1000px,height=1000px;</param>                                                                                                </module>

Weight_Select is a variable from a multi select dropdown. Therefore, the value is 'weight="3" OR weight="2"' for example.

When I pass this through to the Redirector, the other page cannot use this to prepopulate a dropdown for weights. It seems like to URL loader takes in the parameters such as "Weight_Select=2&Weight_Select=3" in order to prepopulate dropdowns. Is there an easy way to prepopulate my weight dropdown in my second page with the redirector?

If this cannot be done, I suppose I could construct my own link.

0 Karma
1 Solution

sideview
SplunkTrust
SplunkTrust

For Redirector keys, all you have to do is follow the normal convention of using $foo.rawValue$ always for links, redirects and human-readable headers, and using the $foo$ key itself only for cases where it's being fed directly into the Splunk search language.

This will work for multiselect Pulldowns as well as single-selection Pulldowns, and indeed it will note the array-valued selection and you'll end up with values in the URL like ?Weight_Select=value1&Weight_Select=value2&Weight_Select=value4.

And in the target view, when URLLoader sees that value, assuming there's a multiselect Pulldown module with a name param of "Weight_Select", it will be able to prepopulate itself to exactly those values when the page loads.

This point, about when to use $foo.rawValue$ and when to use $foo$, is called out as being an important point on the main docs page for using Redirector and URLLoader - go to either "Key Techniques -> linking from view to view -> intro", OR go to "Module Documentation > The URLLoader and Redirector modules". Both of those links actually go to the same page. Note the third bullet item in the "Notes" section.

View solution in original post

sideview
SplunkTrust
SplunkTrust

For Redirector keys, all you have to do is follow the normal convention of using $foo.rawValue$ always for links, redirects and human-readable headers, and using the $foo$ key itself only for cases where it's being fed directly into the Splunk search language.

This will work for multiselect Pulldowns as well as single-selection Pulldowns, and indeed it will note the array-valued selection and you'll end up with values in the URL like ?Weight_Select=value1&Weight_Select=value2&Weight_Select=value4.

And in the target view, when URLLoader sees that value, assuming there's a multiselect Pulldown module with a name param of "Weight_Select", it will be able to prepopulate itself to exactly those values when the page loads.

This point, about when to use $foo.rawValue$ and when to use $foo$, is called out as being an important point on the main docs page for using Redirector and URLLoader - go to either "Key Techniques -> linking from view to view -> intro", OR go to "Module Documentation > The URLLoader and Redirector modules". Both of those links actually go to the same page. Note the third bullet item in the "Notes" section.

Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...