varswitchDecoratedText=CardService.newDecoratedText().setTopLabel("Switch decorated text widget label").setText("This is a decorated text widget with a switch on the right").setWrapText(true).setSwitchControl(CardService.newSwitch().setFieldName("form_input_switch_key").setValue("form_input_switch_value").setOnChangeAction(CardService.newAction().setFunctionName("handleSwitchChange")));
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-10-14。"],[[["The Switch UI element allows users to toggle between on and off states within a DecoratedText widget."],["It's used in Google Workspace Add-ons and Chat apps to collect user input via form submissions."],["Developers can customize the switch's behavior, including its initial state, the value submitted, and actions triggered upon toggling."],["Each switch is identified by a field name, and switches with the same field name submit their values as an array."],["The `setOnChangeAction` method allows developers to specify a function to execute when the switch's state changes, enabling dynamic interactions."]]],[]]