In this guide:
Okta Workflows guides
Okta Workflows guides offer questions and answers from the Okta Workflows community office hours. They also come from the #okta-workflows channel on the Mac Admins Slack and other places. Read all the other guides.
How do you build a Slack Block UI with dynamic inputs via Okta Workflows?
This guide will teach you how to build a Slack Block UI with dynamic inputs in Okta Workflows.
Build Slack Block UI with dynamic inputs
This automation sends this message to Slack and dynamically inserts the two email addresses.

The Slack Block UI JSON for this message looks like this. The dynamic section with the two email addresses is on lines 30-49.
[ { "type": "rich_text", "elements": [ { "type": "rich_text_section", "elements": [ { "type": "text", "text": "The project update is moving through the approval pipeline.\n\n" }, { "type": "text", "text": "The next step requires action from:", "style": { "bold": true } }, { "type": "text", "text": "\n\n" } ] }, { "type": "rich_text_list", "style": "bullet", "indent": 0, "border": 0, "elements": [ { "type": "rich_text_section", "elements": [ { "type": "text", "text": "mona@okta.com" } ] }, { "type": "rich_text_section", "elements": [ { "type": "text", "text": "todd@okta.com" } ] } ] }, { "type": "rich_text_section", "elements": [ { "type": "text", "text": "\n" }, { "type": "link", "url": "https://example.com/tasks/12345", "text": "Click here to view the pending task." } ] } ] }]
The automation has two flows:
- Build Slack Block UI: builds the complete Slack Block UI with the dynamic section and uses the Slack connector to send a message.
- Build User Block – Helper: builds a Slack Block for each email address.
Build Slack Block UI flow
This flow builds the complete Slack Block UI with the dynamic section and uses the Slack connector to send a message.

How the flow works
- The Text-Compose card creates JSON with dynamic data to insert. This is the input.
- The JSON-Parse card creates a JSON object from the input.
- The List-Map card takes the input, processes each email, and returns a JSON list in Slack’s Block UI format.
The JSON list from the List-Map card:
[ { "elements": { "type": "rich_text_section", "elements": [ { "type": "text", "text": "carrie@okta.com" } ] } }, { "elements": { "type": "rich_text_section", "elements": [ { "type": "text", "text": "saul@okta.com" } ] } }]
- Before inserting the emails into the Slack Block UI JSON, you need to remove the elements key. The List-Pluck card creates a list with only the elements values:
[ { "type": "rich_text_section", "elements": [ { "type": "text", "text": "carrie@okta.com" } ] }, { "type": "rich_text_section", "elements": [ { "type": "text", "text": "saul@okta.com" } ] }]
- The JSON-Stringify card converts JSON to a string value.
- The Text-Compose card inserts the input JSON block (email addresses) into the complete Slack Block UI JSON.
- The JSON-Parse card parses the complete message into a JSON object.
- The Object-Get extracts everything under the blocks key from the JSON object. This step is required since the flow uses the Slack-Send Message to Channel action, which has the Blocks field (it requires what’s inside the block).
Build Slack Block UI – Helper flow
This flow takes email input and creates a JSON object for it.

How the flow works
- The flow’s input is an email address.
- The Object-Construct card creates a JSON object.
{ "type": "text", "text": "saul@okta.com"}
- The List-Construct card places the object into a list.
[ { "type": "text", "text": "saul@okta.com" }]
- The Object-Construct card creates an object with a list and another key.
{ "type": "rich_text_section", "elements": [ { "type": "text", "text": "saul@okta.com" } ]}
- The Flow Control-Return card returns the above JSON to the List-Map card. When the List-Map card finishes processing all the items, it returns a list with JSON objects in this format.
The final result is the following message in Slack:

Related Okta Workflows guides
- How to Integrate Okta Workflows and Slack with Webhook and Slash Command.
- Sending Interactive Messages Using Slack’s Block Kit from Okta Workflows.
Okta Workflows resource
🚀 New to Okta Workflows? The How to Get Started with Okta Workflows page outlines straightforward steps to get started.
📺 Like learning from videos? Watch Okta Workflows videos.
❓Have a question? Ask during community office hours, post on the community forum, or email me.
🙋🏻♀️ Want to learn from the community? Join the #okta-workflows channel on the Mac Admins Slack.
📖 Want to learn more about Okta and automation? Take the Okta Workflows training on Okta Learning.
Leave a Reply