Hello, I have created a flow, and it fires every hour, and performes some steps and then send an email.
Is there a way that i can get the time of the day? so I can disable the workflow outside of labor hours?,
Thanks!
How about using @utcnow() on a Data - Compose step and build a condition inside a loop around it to get the time which is in this format: 2017-04-04T14:44:44Z
Hi @courfeyrak,
Could you please share more details about your current flow?
If you just want the flow to run outside the labor hours, then we may consider take use of the recurreccy:
The recurrency would allow to specify the Start time:
You could specify the start time outside the labor hours, and then configure the frequency.
Besides, if you already added the Recurrency, then we could add a condition to check the current time (UtcNow()), if it is within the labor hours, do nothing, otherwise, run the flow action.
For example, the working hours is between 8:00 and 18:00, we could write the following formula under Condition Advanced mode to verify:
@and( GreaterOrequals( formatdatetime(utcnow(),'HH:ss'), formatdatetime('8:00','HH:ss') ), lessOrEquals( formatdatetime(utcnow(),'HH:ss'), formatdatetime('18:00','HH:ss') ) )
See screenshots:
If the current time is within the labor hour range (greater than 8:00 and less than 18:00 in the example), under the IF YES part, specify nothing, under the IF NO part, add your following flow Actions.
Note: UTCNow() function returns the time in UTC time zone, make sure to specify the corrseponding working hour with the proper time.
If you need any further assistance on this topic, please post back.
Regards,
Michael
Slightly different, but same principle I think. I would like a FLOW to run once a day that checks a folder in sharepoint. If the contained files are more than 2 weeks old, delete them.
I'm starting with "SharePoint - List Folder"
then, adding an Apply to Each = "Body"
then, Conditional = if Object Name "Last Modified" is less than... "my guess is to input -14", but I'm not sure and I don't want to delete any more files than necessary.
Any help?
Thanks!
I want to create a similar flow like jbaideme, but I want to delete files on onedrive which are older then 12 month. Has anybody an idea how to do this?
@TheD, I ended up just changing the retension policy for the document library. That is a more straightforward aproach I overlooked at first. Since the files I'm dealing with are not modified and I'm not concerned with that, I just set it for 14 days and it get's rid of every file that's older than (was created past) 14 days. I don't know off hand if OneDrive has a similar retension policy you can set, but you may want to explore that.
Can I identify date rather than time on it?
@and(
GreaterOrequals(
FORMATDATETIME(utcnow(), 'yyyy-MM-dd'),
FORMATDATETIME( '07/29/2018', 'yyyy-MM-dd')
),
lessOrEquals(
FORMATDATETIME(utcnow(), 'yyyy-MM-dd'),
FORMATDATETIME(''07/30/2018' , 'yyyy-MM-dd')
)
)
I tried to use this, but it can no work....
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
User | Count |
---|---|
85 | |
58 | |
43 | |
38 | |
34 |
User | Count |
---|---|
91 | |
74 | |
73 | |
61 | |
41 |