Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

respond support in view_submission listeners (it works only when response_url_enabled is true) #534

Closed
5 of 9 tasks
mogadanez opened this issue Jun 30, 2020 · 2 comments · Fixed by #889
Closed
5 of 9 tasks
Labels
enhancement M-T: A feature request for new functionality
Milestone

Comments

@mogadanez
Copy link

Description

included block into my modal:

{
			"block_id": "my_block_id",
			"type": "input",
			"optional": true,
			"label": {
				"type": "plain_text",
				"text": "Select a channel to post the result on"
			},
			"element": {
				"action_id": "my_action_id",
				"type": "conversations_select",
				"default_to_current_conversation": true,
				"response_url_enabled": true
			}
		}

body payload have response_urls array, but respond function is not available
What is best practice to post delayed response after modal submission?

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.
@seratch seratch added the enhancement M-T: A feature request for new functionality label Jul 1, 2020
@seratch
Copy link
Member

seratch commented Jul 1, 2020

The response_url_enabled is a relatively new option and unfortunately, Bolt for JS doesn't support it yet.

At this point, a possible workaround would be:

// @slack/web-api already depends on axios
const axios = require('axios');

const responseUrls = body.response_urls;
if (responseUrls && responseUrls.length > 0) {
  const url = responseUrls[0].response_url;
  const stateValues = body.view.state.values;
  await axios.post(url, { text: "```" + JSON.stringify(stateValues) + "```" });
}

Also, here is a working example in TypeScript:

@seratch
Copy link
Member

seratch commented Mar 23, 2021

We will implement respond for view submissions in Python first. slackapi/bolt-python#260

@seratch seratch changed the title Modal view_submission, body have response_urls, but respond parameter not available respond support in view_submission listeners (it works only when response_url_enabled is true) Mar 23, 2021
@seratch seratch added this to the 3.4.0 milestone Mar 23, 2021
seratch added a commit to seratch/bolt-js that referenced this issue Apr 19, 2021
…ks only when response_url_enabled is true)
seratch added a commit that referenced this issue Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality
Projects
None yet
3 participants