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"]],["上次更新時間: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."]]],[]]