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.

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: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

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

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