EDIT: Got the value to save but the dropdown box doesn't show up when the correct value (boolean true) is selected
a!radioButtonField( label: "Is Jira Access Required?", labelPosition: "ABOVE", choiceLabels: {"Yes", "No"}, choiceValues: {true, false}, value: ri!record['recordType!{d327a5dc-18d4-4ffd-8bdf-6a22b134677f}DS Contractor.fields.{2463d484-b544-48a5-813c-701935313606}jiraAccess'], saveInto: ri!record['recordType!{d327a5dc-18d4-4ffd-8bdf-6a22b134677f}DS Contractor.fields.{2463d484-b544-48a5-813c-701935313606}jiraAccess'], required: true, choiceLayout: "COMPACT", validations: {} ), a!dropdownField( label: "Which Department Requires Access?", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: cons!DS_deptChoice1, choiceValues: cons!DS_deptChoice1, value: ri!deptChoice1, saveInto: ri!deptChoice1, searchDisplay: "AUTO", showWhen: ri!radioValues2 = true, required: true(), validations: {}
Discussion posts and replies are publicly visible
davinar9817 said:but the dropdown box doesn't show up when the correct value (boolean true) is selected
That's because your showWhen in the dropdown field is still referring to "ri!radioValues2", which is no longer the save target of your Radio Button component.
How do I use the recordtype! field with showWhen? The save target is a boolean and doesn't seem to want to cooperate
What's it doing incorrectly?
So the radio button that I have, when it has a 'true' value, a dropdown is displayed. Ideally, I'd be saving it into the recordtype!field that it corresponds to. When I do save it into its corresponding value, the button choice is saved. However, the dropdown doesn't display due to relying on a rule input inside of the interface. (how the interface rule input helps to display it) ( what I want it to stay as)
I'm not clear what you're actually trying here. Considering your current setup, the code for your dropdown would be changed so that the "showWhen" reflects the save value of your radio button, similar to your previous thread except now referring to the record type data.
a!dropdownField( label: "Which Department Requires Access?", labelPosition: "ABOVE", placeholder: "--- Select a Value ---", choiceLabels: cons!DS_deptChoice1, choiceValues: cons!DS_deptChoice1, value: ri!deptChoice1, saveInto: ri!deptChoice1, searchDisplay: "AUTO", showWhen: ri!record['recordType!{d327a5dc-18d4-4ffd-8bdf-6a22b134677f}DS Contractor.fields.{2463d484-b544-48a5-813c-701935313606}jiraAccess'], required: true(), validations: {} )
Not sure why it wasn't working before, but it works now, thanks!
One thing you should note is that if that value starts out as empty (null, as opposed to true or false), then it might do something unexpected for you: the showWhen parameter defaults to "true" (i.e. passing in a null value is the same as if you passed in nothing), so you might need to also check that in the showWhen parameter. The easy way to do that these days is to wrap the value in a!defaultValue(), like "a!defaultValue( [record type code], false())" (meaning when the record type value resolves as "null()", the showWhen will see a value of "false" and thus stay hidden).