Skip to main content

Notifications

Announcements

No record found.

Service | Customer Service, Contact Center, Fie...
Unanswered

how to get consent for post call surveys

(3) ShareShare
ReportReport
Posted on by 18
I have configured post call surveys at workstream level. I am trying to set the global variable va_surveyconsent in my main bot to ensure post call surveys are to be triggered or not. However, I am unable to read or set this global variable.
 
How can I check this variable value to make sure my surveys are triggered or not
  • Daivat Vartak (v-9davar) Profile Picture
    Daivat Vartak (v-9d... 1,462 Super User 2025 Season 1 on at
    how to get consent for post call surveys
    Hello SparkLight,
     
    You might need support from MSFT (Partner Support) to know if it is feasible to achieve or not and if yes, then what is the method to use. 
     
    MSFT Professional support is unable to assist you in this as they are primarily break-fix engineers. 
     
    Regards,
    Daivat Vartak
  • SparkLight Profile Picture
    SparkLight 18 on at
    how to get consent for post call surveys
     

    I don't want users to opt-in and provide consent. Instead, I want to set a global variable based on the workstream redirected. For example, if the sales team answers the call, post-call surveys should not trigger. However, if the customer service team answers, post-call surveys should be triggered.

    I have added this global variable at the workstream level. Within the bot, I try to set its value, but when the call is transferred to post-call surveys, I cannot read the previously set value.

  • Daivat Vartak (v-9davar) Profile Picture
    Daivat Vartak (v-9d... 1,462 Super User 2025 Season 1 on at
    how to get consent for post call surveys
    Hello SparkLight,
     

    You're on the right track using a global variable to control post-call survey triggering in Omnichannel for Customer Service. However, directly setting and reading global variables from within a bot in the way you're describing isn't the standard approach. Global variables in Omnichannel are typically managed at the workstream level and are used for routing and other workstream-specific logic, not directly for bot control flow.

    Here are the correct ways to achieve what you're trying to do:

    1. Context Variables (Recommended):

    The best way to control survey triggering based on bot interactions is to use context variables. These are variables that are specific to the conversation context and can be passed between the bot and the workstream.

    • Bot Design: In your bot, before the conversation is transferred to the workstream, set a context variable (e.g., surveyConsent). Set its value based on the user's interaction in the bot (e.g., if they opted in for a survey). You can use Power Automate to set this context variable or using the code in the bot itself.
    • Workstream Configuration: In your workstream, in the post-conversation survey settings, you can use rules based on the context variable to determine whether to trigger the survey. You don't need to read a global variable. Instead, you'll check the value of the context variable (e.g., surveyConsent)

    •  

    2. Using Power Automate (Alternative):

    You could use Power Automate to manage the survey triggering logic.

    • Bot: Your bot can send a message or trigger a Power Automate flow when the conversation ends.
    • Power Automate: The flow can then check the relevant information (e.g., user consent stored in a D365 entity or passed as a parameter) and then trigger the post-conversation survey using the Omnichannel APIs.

    •  

    Why Not Global Variables Directly?

    Global variables in Omnichannel are primarily used for:

    • Routing: Directing conversations to the appropriate agents or queues.
    • Workstream Configuration: Setting default behaviors for the workstream.

    They are not designed to be dynamically set and read by bots during a conversation's flow. Context variables are the correct mechanism for this type of scenario.

    How to Implement Context Variables:

    The specific implementation details will depend on the bot framework you're using (e.g., Power Virtual Agents, Azure Bot Framework). Consult the documentation for your bot platform on how to set and pass context variables during a handoff to a workstream. The key is to set the context variable in the bot before the transfer and then use that context variable in your workstream's post-conversation survey configuration rules.

    By using context variables or Power Automate, you'll have a much more robust and maintainable way to control your post-call surveys based on bot interactions.

    If my answer was helpful, please click Like, and if it solved your problem, please mark it as verified to help other community members find more. If you have further questions, please feel free to contact me.
     
    My response was crafted with AI assistance and tailored to provide detailed and actionable guidance for your Microsoft Dynamics 365 query.
     
    Best Regards,
    Daivat Vartak

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,286 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,064 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans