Hey there,
Looks like you've done a great job setting up those regex-based entities! To trigger different topics based on number formats in your conversations, here's a step-by-step guide:
1. Define Regex Entities
Make sure your regex entities are accurately defined for customer numbers, building numbers, and organization VAT numbers. For example:
- **Customer Number:** Regex: `^1\d{7}$` (8 digits starting with 1)
- **Building Number:** Regex: `^\d{18}$` (18 digits)
- **Organization VAT Number:** Regex: `^\d{6}-\d{4}$` (Format: xxxxxx-yyyy)
2. Extract Entities
Use Copilot Studio to extract these entities into variables. This way, the system can recognize and classify the number formats correctly.
3. Custom Middleware (if supported)
Set up middleware to intercept user input and check for regex entities. Based on the identified number format, choose the appropriate topic to trigger.
4. Define Topics
Create topics in Copilot Studio like "Get Customer Data" and "Get Organization Data". Use trigger phrases like "show data about number" to start the conversation.
5. Dynamic Topic Triggering
Write a custom script (if supported) to dynamically check the entity and reroute the conversation to the correct topic. Example:
def determine_topic(entity):
if re.match('^1\d{7}$', entity):
return "Get Customer Data"
elif re.match('^\d{18}$', entity):
return "Get Building Data"
elif re.match('^\d{6}-\d{4}$', entity):
return "Get Organization Data"
else:
return "Default Topic"
user_input = get_user_input()
entity = extract_entity(user_input)
topic = determine_topic(entity)
trigger_topic(topic)
6. Contextual Prompts
Use contextual prompts in your topics to guide the user based on the identified entity.
7. Fallback Mechanism
Set up a fallback mechanism for when the system can't determine the number format. Prompt the user for clarification if needed.
Example Flow:
1. User: "What do we know about 12345678?"
2. System: Recognizes "12345678" as a customer number.
3. System: Triggers "Get Customer Data" topic and fetches relevant data.
Using regex entity extraction and custom logic, you can dynamically trigger the right topics based on the number formats in user conversations.
Hope this helps! Feel free to ask if you need more details. 🌟