cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Flow Updated Sharepoint List and clearing Fields when Time passes

Hello,

I have currently a sharepoint list, connected to powerapps, that has the following...

Support1.PNG

I am creating a flow that shows this list to the user when the employee is out of the office (In between the check-out time and Check-In time) however, I want the Check-out, Check-in, Location, and Notes fields to be clear when the Employee is IN the office (When the time passes the listed Check-In Time). Currently, my flow looks like this...Support2.PNGSupport3.PNG

The first condition just takes the Out of Office column and makes it equal to Yes. If it is Equal to Yes, it updates the field which works when tested. The second condition I want to take the Check-in column and make it less than or equal to the current time. If it is, it updates the item list to clear the fields I listed above however when I test it, that condition comes up with errors. Any help?

Thanks. 

 

 

7 REPLIES 7
Highlighted
Super User II
Super User II

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

@Nickb11  what have you tried in the condition field that's throwing the errors? ie show us your code / dynamic content.

 

I messed around with convert date a month or so ago and couldn't get it to work. I just use addHours(utcNow(),x) now, where 'x' is number of hours I'm off UTC time. Not sure if that helps?

 

Also, are you going to be runing this flow on a schedule? Seems it would need to run a fair bit (maybe 10-12 times/hr?) to pick and change data? I guess, instead of a Flow you could do this all via PowerApps - but only if your users were prepared to check themselves in when they returned to the office?

Highlighted
Community Support
Community Support

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

Hi @Nickb11 ,

 

Could you please share a full screenshot of the configuration your flow?

Could you please share more details about the error message in the Condition2?

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted
Frequent Visitor

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

Sorry about that, I attached below. Thank you. 

Part 1.PNGpart2.PNGpart3.PNGpart4.PNGpart5.PNGpart6.PNGpart7.PNG

Highlighted
Frequent Visitor

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

That is a good idea, I just decided to use flow because I thought it would be easier than making employees have to manually check themselves back in. This timesheet isn't used to record time however, it is used to show a live feed of who is currently checked in and who is not. I'll try that line of code you sent for the time. I saw a video on how to use the convert time feature to set utcnow as the current timezone you are in however I can't tell if it worked or not because I am having trouble with making a relationship with my check in time and the current time. The error keeps showing that I can't make a relationship between my check-in time to be less than or equal to the current time. Also, yes you are right! My flow is going to have a schedule of refreshing every 5-10 minutes. I'm not sure if this might cause problems down the line because I have never personally used flow and don't know if it is reliable to trust a refresh that frequently. 

Highlighted
Super User II
Super User II

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

@Nickb11 

That error appears to be saying you have a BLANK 'Check-in Time' field - which equals Null - and trying to compare that to a date string. Your Flow checks your entire SP List everytime it runs. I can think of two ways to get around this:

 

1. In your 'Get Items':

'Show advanced options' --> in the Filter field try --> 'Out of Office' eq Yes

** note: I (and many newbie Flow-ers) find it difficult to write these Filter queries so have a play around with it, this may not be the exact code to use but you get the idea. What I'm trying to do is remove items where Check-in Time is BLANK (because you are clearing these out when a person returns to the office).

 

2. If the above fails, then after your 'Get items', add a Condition like 'Check-in Time' is not equal to Null (add this via the Expression window, search for null). Then the rest of your Flow follows on the Yes side of this condition.

Highlighted
Frequent Visitor

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

Thanks for the feedback, unfortuantly I got errors both times saying "Bad Request" when I added a filter field of 'Out of Office' eq Yes. I tried the second way as well and I got errors this time on the Update Items action in the yes column saying "Bad Request" as well. 

help1.PNG

Highlighted
Super User II
Super User II

Re: Flow Updated Sharepoint List and clearing Fields when Time passes

@Nickb11 you need to apply that condition (Option 2) before your 1st condition ie right at the start of your 'Apply to Each', if that makes sense. You appear to have it further down in your Flow so it's still checking Null vs String.

 

Flow should be: Recurrance --> Get Items --> Convert Time --> Condition [ check if Check-in Time is Null] --> rest of your flow 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (6,213)