前提・実現したいこと
GAS + slack +block kit builderを用いてbotの作成
発生している問題・エラーメッセージ
block kit builderで作成したselectboxを動的に生成したいがやり方がわからない。
var blockKit = [ { "type": "section", "text": { "type": "mrkdwn", "text": ":mag: Search results for *Cata*" } }, { "type": "divider" }, { "type": "section", "text": { "type": "mrkdwn", "text": "*<fakeLink.toYourApp.com|Use Case Catalogue>*\nUse Case Catalogue for the following departments/roles..." }, "accessory": { "type": "static_select", "placeholder": { "type": "plain_text", "emoji": true, "text": "Manage" }, "options": [ { "text": { "type": "plain_text", "emoji": true, "text": "値0", }, "value": "value-0" }, { "text": { "type": "plain_text", "emoji": true, "text": "値1", }, "value": "value-1" }, { "text": { "type": "plain_text", "emoji": true, "text": "値2" }, "value": "value-2" } =================================================================================================動的に作成 "text": { "type": "plain_text", "emoji": true, "text": "値N" }, "value": "value-N" } ] } },
試したこと
該当箇所を変数にて生成しようとしたが、うまく行かなかった。
date ="{" +"\"text\""+": {" +"\"type\": \"plain_text\"," +"\"emoji\": "+ true + "," +"\"text\": "+ 値N +"}," +"\"value\": \"value-0\" "+"}"
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/01/21 04:51
2020/01/21 05:54
2020/01/21 06:06
2020/01/21 08:29 編集
2020/01/22 16:48
2020/03/13 09:50