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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Answered

Get opening hours from CRM in Copilot studio

(1) ShareShare
ReportReport
Posted on by 9
Hello, 
 
I'm trying to do the following. 

In copilot studio i'm trying to get the opening hours from a spesific record in operating hour (msdyn_operatinghour). From my understanding the daily work schedules are located in "Working Hours" but I have no possible way to list these. 
any suggestions or workaround on this issue?
 
The background to do so is to be able to either escalate to an agent if it's within these opening hours or to promt the end user to create a case for followup. 
I have the same question (0)
  • Verified answer
    April Collier Profile Picture
    21 on at
    I managed to do this, but I had to use power automate for it. Hopefully it'll help you out:
     
    1.  Pass in the Queue name that you want to check to a power automate flow
    2. Within that flow, grab the associated msdyn_operatinghourid from the Queue (dataverse get a row by id)
    3. Get the Calendar (dataverse get a row id) using the msdyn_operatinghourid as the Row ID
    4. Using a compose, create your search parameters (this was the tricky part for me, so I will paste in a screenshot of this):
    The outputs for StartDate and EndDate are both my Current DateTime action (since I wanted to search for "now" in my case)
     
    5. Call the LoadCalenders action (this is an unbound dataverse action), pass in the outputs of your JSON compose statement above.
    6. Parse the response
    7. Use the TimeCode in the response for your purposes. From what I tested, 0 is for Available, 1 is Busy, 2 is Unavailable. There is also a SubCode that I believe is for Holiday or Break, but I did not need to use it so I didn't test it fully.
    8. Return your response to Copilot using the respond to copilot action.
     
    I hope this works for you and saves you some headaches! I have more screenshots if you need it.
  • Adrian Sjoholt Profile Picture
    9 on at
    @April Collier thank you so much for the suggested solution!
    I was able to use this to get the state of the opening hours. 
    And then created a do until where I iterated every 15 minutes to find when it was open and when it was closed to create the opening hours as well as the state. 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 61 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans