Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Copilot Studio - General
Answered

How to restrict number of questions that user can ask in Chatbot?

(0) ShareShare
ReportReport
Posted on by 392

Hello,

I have developed a chatbot using the Production Chatbot feature in PVA.

https://www.linkedin.com/pulse/connecting-openai-power-virtual-agent-part-2-keeping-r%C3%A9mi-dyon/

In the backend, I am using Power Automate and Open-AI API to provide responses to user queries. The conversation logs are being saved in a SharePoint list.

My question is regarding the implementation of a limit on the number of questions that users can ask the chatbot. I would like to restrict users to ask less than 10 questions. If they exceed this limit, the chatbot should respond with a message apologizing for crossing the limit.

I would appreciate any suggestions on how to implement this feature. Thank you in advance.


  • Verified answer
    HenryJammes Profile Picture
    on at
    Re: How to restrict number of questions that user can ask in Chatbot?

    Hi @Jupyter123, OK got it, that would be a limit per-user.

     

    In that case, I'm guessing you'd need to keep a count outside of PVA itself, for example in a custom table in the hosting Dataverse environment. If the bot is deployed to Teams, you could store the user email address, the count of messages, and the date. In Dataverse, you can also set a a bulk delete job to delete records every day and use that to reset the counter.

     

    That means on the PVA side you'd need to kick off a Power Automate cloud flow every time the user enters the loop to keep track of the counter for that day, and your flow will have some sort of upsert logic to create/update the user record with the counter value for that day.

     

    Henry

  • Jupyter123 Profile Picture
    392 on at
    Re: How to restrict number of questions that user can ask in Chatbot?

    Hi again @HenryJammes , Thanks for the response.
    If I  add a variable in my logic and increment it by 1 every time a user loops, and  that forces the user to exist the loop once they reach 10.
    But the problem is, it will be for every user who use the bot, it wont be user specific...
    Maximum a single user can ask 10 questions in a day and next day the count should be reset to 0..
    this seems complicated but i was wondering, is it even possible to do this way considering the user and time?

  • HenryJammes Profile Picture
    on at
    Re: How to restrict number of questions that user can ask in Chatbot?

    Hi @Jupyter123,

     

    I don’t think there is an out-of-the-box way for this in the existing ‘Ask a question’ behavior options (https://learn.microsoft.com/en-us/power-virtual-agents/preview/authoring-ask-a-question).

     

    To work around this, you could add a variable in your logic and increment it by 1 every time a user loops, and add a test at the end of your logic that forces the user to exist the loop once they reach 10.

     

    Henry

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 the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Leaderboard > Copilot Studio - General

#1
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 74

#2
Pablo Roldan Profile Picture

Pablo Roldan 61

#3
stampcoin Profile Picture

stampcoin 10

Overall leaderboard