1

我正在尝试从松弛模式有效负载(使用 Integromat)中获取提交的数据,但我无法将字段匹配为字段名称(block_ids),并且无法在每次提交时随机更改。

不知道从哪里开始,在 Slack 方面我可以做些什么来阻止这个,或者我该如何在 Integromat 中处理这个?

有效载荷如下:

在此处输入图像描述

{
   "blocks":[
      {
         "type":"header",
         "block_id":"GH6Wh",
         "text":{
            "type":"plain_text",
            "text":"AHome",
            "emoji":true
         }
      },
      {
         "type":"input",
         "block_id":"ayv5",
         "label":{
            "type":"plain_text",
            "text":"Project Title",
            "emoji":true
         },
         "optional":false,
         "dispatch_action":false,
         "element":{
            "type":"plain_text_input",
            "action_id":"field_project_title",
            "dispatch_action_config":{
               "trigger_actions_on":[
                  "on_enter_pressed"
               ]
            }
         }
      },
      {
         "type":"input",
         "block_id":"4Tf7",
         "label":{
            "type":"plain_text",
            "text":"Client Project Contacts",
            "emoji":true
         },
         "optional":false,
         "dispatch_action":false,
         "element":{
            "type":"multi_static_select",
            "action_id":"client_project_contacts",
            "placeholder":{
               "type":"plain_text",
               "text":"Select",
               "emoji":true
            },
            "options":[
               {
                  "text":{
                     "type":"plain_text",
                     "text":"jennifer",
                     "emoji":true
                  },
                  "value":"47dht5f-1942-4448-9842-20fef64dcd67"
               }
            ]
         }
      },
      {
         "type":"divider",
         "block_id":"a=6G"
      },
      {
         "type":"section",
         "block_id":"qtq0W",
         "text":{
            "type":"mrkdwn",
            "text":"Project Start",
            "verbatim":false
         },
         "accessory":{
            "type":"datepicker",
            "action_id":"field_project_start_date",
            "initial_date":"2022-01-19",
            "placeholder":{
               "type":"plain_text",
               "text":"Select a date",
               "emoji":true
            }
         }
      },
      {
         "type":"section",
         "block_id":"4YOTI",
         "text":{
            "type":"mrkdwn",
            "text":"Project Finish",
            "verbatim":false
         },
         "accessory":{
            "type":"datepicker",
            "action_id":"field_project_end_date",
            "initial_date":"2022-03-19",
            "placeholder":{
               "type":"plain_text",
               "text":"Select a date",
               "emoji":true
            }
         }
      },
      {
         "type":"divider",
         "block_id":"MZU"
      },
      {
         "type":"input",
         "block_id":"v09",
         "label":{
            "type":"plain_text",
            "text":"Project Manager",
            "emoji":true
         },
         "optional":false,
         "dispatch_action":false,
         "element":{
            "type":"static_select",
            "action_id":"field_project_managers",
            "placeholder":{
               "type":"plain_text",
               "text":"Select",
               "emoji":true
            },
            "options":[
               {
                  "text":{
                     "type":"plain_text",
                     "text":"Eric ",
                     "emoji":true
                  },
                  "value":"b85ba51b-2346-481f-98a8-2b94fh994575"
               }
            ]
         }
      },
      {
         "type":"input",
         "block_id":"gxN9",
         "label":{
            "type":"plain_text",
            "text":"Project Team",
            "emoji":true
         },
         "optional":false,
         "dispatch_action":false,
         "element":{
            "type":"multi_static_select",
            "action_id":"field_project_team",
            "placeholder":{
               "type":"plain_text",
               "text":"Select",
               "emoji":true
            },
            "options":[
               
            ]
         }
      },
      {
         "type":"divider",
         "block_id":"CU1k"
      },
      {
         "type":"input",
         "block_id":"ows",
         "label":{
            "type":"plain_text",
            "text":"Setup apps",
            "emoji":true
         },
         "optional":true,
         "dispatch_action":false,
         "element":{
            "type":"checkboxes",
            "action_id":"setup_apps",
            "options":[
               {
                  "text":{
                     "type":"plain_text",
                     "text":"Harvest",
                     "emoji":true
                  },
                  "value":"setup_harvest"
               },
               {
                  "text":{
                     "type":"plain_text",
                     "text":"Dropbox Project Folder",
                     "emoji":true
                  },
                  "value":"setup_dropbox"
               }
            ]
         }
      },
      {
         "type":"divider",
         "block_id":"Eov"
      }
   ],
   "private_metadata":"",
   "callback_id":"_project_setup_form_submit",
   "state":{
      "values":{
         "ayv5":{
            "field_project_title":{
               "type":"plain_text_input",
               "value":"cvgf"
            }
         },
         "4Tf7":{
            "client_project_contacts":{
               "type":"multi_static_select",
               "selected_options":[
                  {
                     "text":{
                        "type":"plain_text",
                        "text":"Jennifer",
                        "emoji":true
                     },
                     "value":"04a96f00-c84d-403c-992f-28fgh34b7ade"
                  }
               ]
            }
         },
         "qtq0W":{
            "field_project_start_date":{
               "type":"datepicker",
               "selected_date":"2022-01-19"
            }
         },
         "4YOTI":{
            "field_project_end_date":{
               "type":"datepicker",
               "selected_date":"2022-03-19"
            }
         },
         "v09":{
            "field_project_managers":{
               "type":"static_select",
               "selected_option":{
                  "text":{
                     "type":"plain_text",
                     "text":"Eric",
                     "emoji":true
                  },
                  "value":"b85ba51b-2346-481f-9sa8-2b9468994575"
               }
            }
         },
         "gxN9":{
            "field_project_team":{
               "type":"multi_static_select",
               "selected_options":[
                  {
                     "text":{
                        "type":"plain_text",
                        "text":"Elliot",
                        "emoji":true
                     },
                     "value":"94c4b483-fbg8-4211-971d-38cf615fdc5e"
                  }
               ]
            }
         },
         "ows":{
            "setup_apps":{
               "type":"checkboxes",
               "selected_options":[
                  {
                     "text":{
                        "type":"plain_text",
                        "text":"Harvest",
                        "emoji":true
                     },
                     "value":"setup_harvest"
                  }
               ]
            }
         }
      }
   }
}
4

1 回答 1

0

创建视图时,您可以(但不是必须)将 a 指定"block_id"为每个块的属性。如果没有提供 ID,它似乎每次都是随机生成的。

例子:

{
  "type": "modal",
  "callback_id": "modal-identifier",
  "title": {
    "type": "plain_text",
    "text": "Just a modal"
  },
  "blocks": [
    {
      "type": "section",
      "block_id": "section-identifier",
      "text": {
        "type": "mrkdwn",
        "text": "*Welcome* to ~my~ Block Kit _modal_!"
      },
      "accessory": {
        "type": "button",
        "block_id": "just-a-button",
        "text": {
          "type": "plain_text",
          "text": "Just a button",
        },
        "action_id": "button-identifier",
      }
    }
  ],
}

Source,我"block_id"为按钮添加了第二个。

于 2022-02-07T15:41:52.797 回答