In splunk Dashboard How to hide/unhide input radio choice options based on previous input? - splunk

In splunk dashboard(Classic) I want to hide/hide the input radio option choice based on previous input radio button selection.
<form>
<label>tst2</label>
<fieldset>
<input type="radio" token="environment">
<label>ENV</label>
<choice value="US">USA</choice>
<choice value="Asia">APAC</choice>
<choice value="UAE">UAE</choice>
</input>
<input type="radio" token="sub-environment1">
<label>S-ENV</label>
<choice value="*">All</choice>
<choice value="NewYork">NY</choice>
<choice value="LA">LA</choice>
<choice value="Washington">WT</choice>
<choice value="Delhi">DL</choice>
<choice value="Mumbai">MB</choice>
<choice value="Tokio">TK</choice>
<choice value="Dubai">DB</choice>
<choice value="Abu-Dabhi">ABD</choice>
</input>
</fieldset>
</form>
In this case
if i select USA then it should display - NY,LA,WT and * . Rest all other sub-environment should hide.
if i select APAC it should display radio inputs as DL, MB,TK and * . Rest all other sub-environment should hide.
if i select UAE it should display DB, ABD and * . Rest all other sub-environment should hide.
Is there any why we can use tokens or depends or any other approach to hide/unhide these second(sub-environment) radio input choices

The depends="$token$" format works on almost every XML element in Splunk Dashboards
I do this to force choices to happen in a certain order
For example, if you must choose a Region before a Datacenter, you might have the dropdown for Datacenter have depends="$regiontok$", so that Region has to be set first

Related

How to get related value from SelectList

Using .NET 5.0 and Azure SQL
I am trying to figure out how to get a related value when I make a selection from a drop down list and pass that value to a hidden input field.
My select list (id="customer" is for the jQuery Chosen plugin):
<select id="customer" asp-for="Assignment.Retailer_ASM" class="form-control" asp-items="ViewBag.Retailer_ASM">
<option value="">--Customers--</option>
</select>
So when a user selects a customer from this list, there is a FK value that I want to pass into the hidden input, which is used for RLS.
<input type="hidden" asp-for="Assignment.RlsArea" value="What to put here?" class="form-control" />
The value would be like Assignment.Retailer_ASM.RegionID, an INT for the selected Retailer_ASM.

vuejs model not updating when using an address lookup

I am using a postcode search service to populate address form fields.
When an address is selected, the form fields are populated correctly, i.e. town is in town field etc.
Problem is, it doesn't update the model.
<div class="form-group address">
<label for="postcodeFormField">Postcode *</label>
<input name="postcode" v-model="contact.postcode" type="text" class="form-control" id="postcodeFormField" placeholder="SW7 3RX" required>
</div>
If I manually type into the fields, it does update the model. But the address data which displays in the form fields after an address is selected, is not being reflected in the model.
Add a ref to the input i.e ref="postcodeFormField"
Hit a method on submit button #click="myMethod()"
In that method:this.$refs.postcodeFormField.dispatchEvent(new Event('input'));

Splunk dashboard - token in search query

I'm new to Splunk, and I'm investigating the structure of an XML dashboard. I see the following in the code:
<input id="input" type="dropdown" token="serve" searchWhenChanged="false">
<label>Serve</label>
<fieldForLabel>serve</fieldForLabel>
<fieldForValue>name</fieldForValue>
<search id="search_serve">
<query>$custom_search$</query>
<earliest></earliest>
<latest></latest>
</search>
</input>
Searching through the complete XML file, I do not see the
$custom_search$
token listed anywhere. Is there another location where this token can be defined?
Try searching for custom_search instead of $custom_search$ within the XML.
When defined, the token won't include the dollar ($) signs. They are only included when the token is used.
What the provided dropdown does, is it dynamically populates dropdown values based on the output of another search passed via custom_search token
Here's an example where the dropdown is populated with the sourcetypes for either _internal or _introspection indexes. Notice how when defined, token is called custom_search
<input type="radio" token="custom_search">
and when used token is used as $custom_search$
<query>$custom_search$</query>
Feel free to slap the example in a dashboard to see it in action
<form>
<label>Search as token</label>
<fieldset submitButton="false">
<input type="radio" token="custom_search">
<label>Select Index</label>
<choice value="index=_internal |stats c by sourcetype|table sourcetype">_internal</choice>
<choice value="index=_introspection |stats c by sourcetype|table sourcetype">_introspection</choice>
<default>index=_internal |stats c by sourcetype|table sourcetype</default>
</input>
</fieldset>
<row>
<panel>
<input id="input" type="dropdown" token="serve" searchWhenChanged="false">
<label>Sourcetype</label>
<fieldForLabel>Sourcetype</fieldForLabel>
<fieldForValue>sourcetype</fieldForValue>
<search id="search_serve">
<query>$custom_search$</query>
<earliest></earliest>
<latest></latest>
</search>
</input>
</panel>
</row>
</form>
If this fixes your problem, take a moment to accept the answer. This can be done by clicking on the check mark beside the answer to toggle it from greyed out to filled in!

How can I access extra customer registration form field values via the Bigcommerce API?

In the bigcommerce control panel, you are given the option to
add extra fields to the customer registration form.
This is shown in the control panel when Editing a customer record. They
show up, in the rendered html as this kind of thing:
<div class="field formRow ">
<label for="FormField_24"><span class="FormFieldLabel">FIELD NAME</span>
...
</label>
<div class="field-group value">
<input type="hidden" value="24" class="FormFieldId">
<input type="hidden" value="1" class="FormFieldFormId">
...
<input type="text" value="FIELD VALUE" class="field-xlarge FormField"
name="FormField[1][24]" id="FormField_24" ...>
</div>
</div>
However, walking the records with the Customer API doesn't show any of these extra fields.
Is there is anything in the Bigcommerce API that will let me access these custom customer form fields?
Update:
There are some older questions about this, that I didn't spot in searching (here, and here).
Given that those questions are from January & July last year, and still have no solution, it looks like this is simply a gap in the API. Damn.

vxml: can i switch between voice prompt and enumeration prompts?

I am using vxml powered by an engine similar to TellMe. I adding voice recognition to telephone prompts for a voice mail system. The new menu will first prompt the user for verbal input, and if no match is found, or if no input is given, the user is prompted again with touch tone options.
The original menus look like this:
<menu id="msgedit">
<prompt><enumerate><value expr="_prompt"/>press <value expr="_dtmf"/>.</enumerate></prompt>
<choice dtmf="9" next="#checkurgent">To deliver your message </choice>
<choice dtmf="7" next="#playmsg">To play your message </choice>
<choice dtmf="3" next="#rerecord">To discard your message and record over </choice>
<choice dtmf="2" next="#addtomsg">To add to your message </choice>
<choice dtmf="6" next="#testnumber">To enter a phone number where you may be reached </choice>
<choice dtmf="1" next="#cancel">To cancel making a message </choice>
<!-- handle no input/no match -->
</menu>
The new menu looks like this:
<form id="msgedit">
<field name="choice">
<prompt>
<if count == 0">
Please choose one of the following.
deliver, play back, rerecord, add to,
enter a callback number, or cancel.
<else/>
Please choose one of the following.
To deliver your message, press 9.
To play back your message, press 7.
To discard your message and rerecord, press 3.
To add to your message, press 2.
To enter a callback number, press 6.
To cancel your message, press 1.
</if>
</prompt>
</field>
<filled>
<if cond="choice == 'deliver' || choice == '9'">
<goto next="#checkurgent"/>
<elseif cond="choice == 'play' || choice == '7'"/>
<goto next="#playmsg"/>
<elseif cond="choice == 'rerecord' || choice == '3'"/>
<goto next="#rerecord"/>
<elseif cond="choice == 'add' || choice == 'add to' || choice == '2'"/>
<goto next="#addtomsg"/>
<elseif cond="choice == 'enter callback number' || choice == 'callback number' || choice =='6'"/>
<goto next="#testnumber"/>
<elseif cond="choice == 'cancel' || choice =='1'"/>
<goto next="#cancel"/>
<else/>
<throw event="nomatch"/>
</if>
</filled>
<!-- handle no input/no match -->
</form>
However, I want to use the <enumerate> and <choice> behavior from the original menu to reprompt instead of the long text (which is too long and causes an error).
HERE'S THE QUESTION: is there a way to use the first style of prompt within the second style of prompt? can i put and inside of a field? and how would i do that?
The choice element is specific to menu. While can use enumerate in a general prompts, the way it is used in the first example, it is tying the prompts to the allowed input. For a field, you are getting the available inputs from a defined grammar.
On the latter point, your snippet doesn't mention grammar nor does the field indicate a type. Is the grammar defined at a higher level within the VoiceXML document or a built in grammar ? If not, that may be the source of your error.
You can use speech recognition with menus and choices, but the way the selections are defined with the enumeration:
This is a modified example from the VoiceXML 2.0 specification:
<menu>
<choice dtmf="1" next="http://www.sports.example.com/vxml/start.vxml">
<grammar src="sports.grxml" type="application/srgs+xml"/>
Press 1 or say Sports for sports scores
</choice>
<choice dtmf="2" next="http://www.weather.example.com/intro.vxml">
<grammar src="weather.grxml" type="application/srgs+xml"/>
Press 2 or say weather for weather
</choice>
<choice dtmf="3" next="http://www.stargazer.example.com/voice/astronews.vxml">
<grammar src="astronews.grxml" type="application/srgs+xml"/>
press 3 or say Stargazer astrophysics for ?
</choice>
</menu>
If you put the prompts into an ECMAScript array, you could probably use the enumeration as well.
In general, I would recommend the field approach. You gain a lot more flexibility for providing rich prompts and error handling. menu/choice is a shortcut mechanism that is meant for simple, limited cases.