---
schema_version: "1"
id: 8bdfa3bd3bc29d63df0f6b7afb551617476551fbfaf685695d64dedcd6ab2993
title: "Question with Dynamic Options: Example Flow"
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/service/264-0-0/bots_service_enhanced_question_dynamic_flow.md
canonical_url: https://help.salesforce.com/s/articleView?id=service.bots_service_enhanced_question_dynamic_flow.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 75f2a57691726a1a6d060f847a7296dab6a43b2d35e4e22d2ed6926997e90c6f
description: To use a question with dynamic options with your enhanced bot, create an autolaunched flow to populate the options from the objects and fields you specify. The flow must return an ID list variable as output for use with the bot.
products:
  - Service Cloud
  - Service Intelligence
release: "264"
---
# Question with Dynamic Options: Example Flow

To use a question with dynamic options with your enhanced bot, create an autolaunched flow to populate the options from the objects and fields you specify. The flow must return an ID list variable as output for use with the bot.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.einstein_service_intro.htm&amp;language=en_US" target="_blank">View supported editions</a> for Einstein Bots.</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;"><a href="https://help.salesforce.com/s/articleView?id=service.messaging_editions.htm&amp;language=en_US" target="_blank">View supported editions</a> for Messaging.</td></tr></tbody></table>

The Get Cases for Bots flow searches cases and filters by priority. It returns the three most recent high-priority cases and stores the results in an ID list variable.

![The Get Cases for Bots example flow](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_messaging_question_flow.png)

After you create a flow, in the bot, add a Flow action dialog step that references your flow and store the output in an ID list bot variable. In the associated Question (Dynamic) dialog step, reference the same ID list bot variable in the Record ID Options input parameter.

## A Closer Look at the Get Cases for Bots Example Flow

In this example, the Get Records element, Get Cases For Bots, searches the Case object for recent high-priority cases.

![A Get Records element](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_messaging_question_get_records1.png)

It selectively stores the ID field from the Case records in the CaseList record collection (or record list) variable.

![A Get Records element](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_messaging_question_get_records2.png)

To convert the record collection to a record ID list, the flow uses the Loop and Assignment elements. The Convert Record to Record ID List Loop element grabs the ID field from each Case record stored in the CaseList record collection variable. The Assign Case ID to Collection Variable Assignment element adds each record ID field grabbed from the CaseList collection variable to the CaseIdList record ID list variable.

![A Loop element](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_messaging_question_loop.png)

![An Assignment element](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-service-support_intelligence-264-0-0-production-enus/dcd06a7b-b5ab-448b-a767-4e2e90481508/support_intelligence/images/bots/bots_service_messaging_question_assignment.png)