cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeKi72
Helper III
Helper III

Check the local C:\Temp before the flow send a message to the user.

Dear Experts,

 

I have a flow where i send myself a scheduled message through Teams.  Every day a reminder will be send to me at 18:00.

Now I want to share my flow with my colleagues. I presume that when i share my flow with my colleagues they all get a copy

of my flow. Because Power Automate is a online application i ques everyone get a message a 18:00. What I would like is to

prevent a flow from running for a user when the user is not working. My idea was before a reminder will be send the flow 

checks the C:\Temp. If the user is not working the flow can not check the C:\Temp and the flow will fail. Is that possible?

Or perhaps better ideas?

 

PeKi72_0-1652698571251.png

 

 

Thanks you in advanced, Gr. P

 

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Dual Super User
Dual Super User

Hi @PeKi72,

 

I thought that probably was the easiest since you can also collect that information from the cloud.

 

When using the check if C:\Temp folder is accessible approach you will need access to local resources of a persons device. This would mean installation of a Personal data gateway on the machine of that person. It also means the gateway service needs to be up an running during the work day.

 

That being said, with that gateway the setup could be something like below.

The list files in folder uses the data gateway connection and points to the C:\Temp folder in the connection. The condition action is configured to use both succeeded and has failed in the configure run after settings.

 

In the condition the status value is check. If it equals Failed this means for some technical reason the C:\Temp cannot be reached.

 

actions('List_files_in_folder')?['Status']

 

 

You can add the Adaptive card in the If No section in this example.

 

datagateway_listfilesinfolder.png

View solution in original post

7 REPLIES 7
Expiscornovus
Dual Super User
Dual Super User

Hi @PeKi72,

 

My suggestion would be to use the automatic replies of a user. In a lot of companies people enable their out of office reply whenever they are not working. Is that also the case in your company/in this scenario?

 

Below is an example of using the OoO message in your setup.

It uses the Get mail tips for a mailbox (v2) action and with a condition it makes sure that the automaticReplies field is empty.

 

 

empty(body('Get_mail_tips_for_a_mailbox_(V2)')['value'][0]['automaticReplies'])

 

 

notworking_outofofficereply.png

 

PeKi72
Helper III
Helper III

Unfortunally it is not the case in my company

 

Expiscornovus
Dual Super User
Dual Super User

Hi @PeKi72,

 

I thought that probably was the easiest since you can also collect that information from the cloud.

 

When using the check if C:\Temp folder is accessible approach you will need access to local resources of a persons device. This would mean installation of a Personal data gateway on the machine of that person. It also means the gateway service needs to be up an running during the work day.

 

That being said, with that gateway the setup could be something like below.

The list files in folder uses the data gateway connection and points to the C:\Temp folder in the connection. The condition action is configured to use both succeeded and has failed in the configure run after settings.

 

In the condition the status value is check. If it equals Failed this means for some technical reason the C:\Temp cannot be reached.

 

actions('List_files_in_folder')?['Status']

 

 

You can add the Adaptive card in the If No section in this example.

 

datagateway_listfilesinfolder.png

PeKi72
Helper III
Helper III

I was thinking can this also be done with a pesons onedrive? If a user isn't working is his onedrive accessible or not?

If not then we better use his onedrive. Is that possible? Btw thank you for helping me

Expiscornovus
Dual Super User
Dual Super User

Hi @PeKi72,

 

Their OneDrive would be accessible even though they are not working on it. Because I assume in their copy of the flow they would use their own account for the connection.

 

However, with Onedrive you could check what the time is of the last modified document. If that was a time between 17:55 and 18:00 you might be able to assume that they are still working recently. But at the same time they might have been in and out of meetings without working on any document at all. I still consider that working  😉

 

Another approach would be to check the presence of the user. 

 

I think the most important thing for this automation is that we first define what is 'still working at 18:00' 😁

PeKi72
Helper III
Helper III

Is it possible to check the presence of the user in Teams?

PeKi72
Helper III
Helper III

Maybe this:

PeKi72_0-1652723213610.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (2,567)