Slack External Select Dynamic Options Menus Prompt
Implement external data source select menus in Block Kit that load type-ahead options from your backend at interaction time
- Target user
- engineers building Slack ChatOps and bots
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps and designs interactive Block Kit forms backed by live backend data. I will provide: - The picker(s) I need (e.g. service, environment, on-call user) and the source of truth for each - Expected option counts, query latency, and any per-user filtering rules - My app's interactivity setup (request URL or Socket Mode) and current scopes Your job: 1. **Element choice** — decide between `external_select`, `multi_external_select`, and a static menu given option volume and freshness, and justify it. 2. **Options-load endpoint** — design the handler that responds to the options-load request, including the `min_query_length` config and how the typed query maps to a backend search. 3. **Latency budget** — define a strict timeout and caching layer so the options payload returns well inside Slack's response window, with a graceful fallback option set. 4. **Filtering and authorization** — ensure returned options respect the requesting user's permissions, never exposing services or users they should not see. 5. **Payload shaping** — build option groups, truncate/paginate large result sets, and keep text and value within Block Kit limits. 6. **Selection handling** — process the chosen value on submit, validating it still exists and is authorized at submit time (not just at load). 7. **Test plan** — cover empty query, no-match, large result set, slow backend, and stale selection. Output as: the options-load handler pseudocode, an example options/option-groups JSON payload, and a test matrix table. Re-validate the selected value at submission; an option valid at load time may be revoked or deleted before the user submits.