Show a dropdown that has an "Other" option at the end of the list of choices. If the user selects "Other", show a required text field.
This scenario demonstrates:
How to configure a dropdown with an appended value
How to conditionally show a field based the selection of an 'Other' option
How to save one of two values when evaluating a form through a submit button
This expression shows how to modify the above expression for offline use.
Test it out
Select Other in the dropdown, enter a value and click on the Submit button. Notice that the value saves on the submit button.
Notable implementation details
Notice that we cleared out the opposite variable upon submission so that only one variable gets updated. That is, if the user filled out the "Other" field and then switched the dropdown back to an available option, local!other would be set to null on submission of the form.
The offline version of this recipe cannot have conditional display, so the showWhen parameter of the Other text field has been removed.