How can I assign a default value to a radio button and make sure that value is saved even if the user doesn't interact with a radio button component?
for instance, if I have local!radioButtonDefaultValue: false
I see that the No label is selected, when value field of the component is set to local!radioButtonDefaultValue but the value itself isn't saved automatically unless the user interacts with the radio button component. I want to save the false value even if there is no interaction with the component.
Discussion posts and replies are publicly visible
Hi Amit, You can set the value as true or false in your process variable itself , so when your process starts , your rule input will have by default value from the pv. you can also save this value in any other field's saveInto. i hope it helps.
https://docs.appian.com/suite/help/22.1/recipe-set-the-default-value-of-an-input-on-a-start-form.html
https://docs.appian.com/suite/help/22.1/recipe-set-the-default-value-of-an-input-on-a-task-form.html
docs.appian.com/.../recipe-set-the-default-value-based-on-a-user-input.html
Hi there,
When creating the variable, define its value or use a script task after the start node to set the desired value of the desired variable.
Personally I take a different approach than others have suggested (defaulting data in the process model) - instead I usually use local variables to set a default value for fields and then use a button click to then transfer the results to the corresponding local variable. The advantage of this method is that your form can not be tested entirely on its own.
For example, given your default value above, you could do something like this:
a!localVariables( local!radioButtonDefaultValue: false, a!formLayout( label: "Test Form", contents: { a!radioButtonField( label: "Status", choiceValues: {true, false}, choiceLabels: {"Active", "Inactive"}, value: local!radioButtonDefaultValue, saveInto: local!radioButtonDefaultValue ) }, buttons: a!buttonLayout( primaryButtons: a!buttonWidget( label: "SUBMIT", submit: true, saveInto: a!save( target: ri!status, value: local!radioButtonDefaultValue ) ) ) ) )
The button click always works well because it's guaranteed that they must click the button to move on (and it will always be the last thing they do on the form).