web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / Power Virtual Agents: ...
Copilot Studio
Unanswered

Power Virtual Agents: how to check if current chat time is within operating hours

(0) ShareShare
ReportReport
Posted on by 40

Hello Community,

I have the following requirements when configuring the PVA bot that's integrated with D365 Customer Service Omnichannel:

- The Omnichannel queue in D365 Customer Service is tied to an operating hours (i.e. 8am - 5pm EST)

- The PVA bot will operate 24/7 (i.e. there is no operating hours tied to the chat widget in the Chat Channel)

- The idea here is that customers can always go to the website and chat with the bot. If the time is within the customer support's operating hours, the bot will transfer the conversation to a live agent. If the time is outside of the customer support's operating hours, then the customer can only interact with the bot to get some automated response.

 

My question is: how would I be able to check inside the PVA bot topic if the current time is within the operating hours of the queue, which is stored in D365?

 

Does anyone have any ideas how the above could be implemented? Thanks!

Categories:
I have the same question (0)
  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    You can use Hour(Now()) to get the local hour in PVA. You can also use Text(Now(),"dddd") to get the day of the week in local time. You could use this in a condition to determine whether or not you wanted to transfer to an agent or output a message saying all agents are currently offline. Here's a Condition I made (you have to switch to Formula mode to be able to enter this) that checks to see if it's Saturday, Sunday, or outside of 8a-5p local time. This would effectively let you make the decision on how to determine what happens next, based on your needs.

     

    Or(Or(Text(Now(),"dddd") = "Saturday", Text(Now(),"dddd") = "Sunday"), Or(Hour(Now()) < 8, Hour(Now()) > 16))

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

  • D365EL Profile Picture
    40 on at

    Hi @MattJimison,

     

    Thank you for sharing the input! However, what if the operating hours are not something I can define directly within the PVA condition? For example, I have the PVA bot integrated with D365 Customer Service Omnichannel, and I need to compare the PVA bot current time against the operating hours that's stored against the Omnichannel queue record in D365? As the operating hours could be updated in D365, I don't think it's a good idea to "hard code" the hours value in the conditional check in PVA, but rather if we could pass the operating hours from D365 to PVA for the check. Would you happen to know how this could be done - how we could check the current time in PVA against the operating hours of the queue that's in D365?

     

    Thanks!

  • MattJimison Profile Picture
    579 Most Valuable Professional on at

    I’d create a flow to determine the operating hours, which would be returned to PVA (start and end hours), where you’d capture them as variables, and then you’d compare the current time to those variables instead of hard-codes values (ie Topic.StartHour and Topic.EndHour)

     


    Find this post helpful? Please mark it as the solution and/or provide kudos so that it will help others in the future.

    Cheers,
    Matt

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 177

#2
Romain The Low-Code Bearded Bear Profile Picture

Romain The Low-Code... 130 Super User 2026 Season 1

#3
chiaraalina Profile Picture

chiaraalina 45 Super User 2026 Season 1

Last 30 days Overall leaderboard