Reply
Joschko
Helper I
Helper I

Pipeline : Run activity on Monday to Friday between 9am and 7pm

Hello,
I would like to run an activity in the pipeline only from Monday to Friday from 7:00 to 17:00.
I have added an If Condition Activity for this purpose.
I use the following expression for the false part to exclude Saturday and Sunday.

@OR(
equals(dayOfWeek(convertFromUtc(utcNow(),'W. Europe Standard Time')),0),
equals(dayOfWeek(convertFromUtc(utcNow(), 'W. Europe Standard Time')),6)
)

I don't know how to do this for the hours 7:00 to 17:00. The hour function, as in ADF, is not available. Do i miss anything?

Thank you very much for reading

1 ACCEPTED SOLUTION
NandanHegde
Super User
Super User

Hey,

You can use formatdatetime function to get the hour details :

https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#form...

 

Something like below :

@formatDateTime( utcnow(),'hh')



----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

View solution in original post

3 REPLIES 3
Joschko
Helper I
Helper I

Hey, thank you. That worked.

 

Here is the expression to exit (results to true, only monday to sunday between 9am and 5pm):

Please note that line breaks are accepted in the editor but leading to errors when executed.

 

 

@or(or(or(equals(dayOfWeek(convertFromUtc(utcNow(),'W. Europe Standard Time')),0),equals(dayOfWeek(convertFromUtc(utcNow(), 'W. Europe Standard Time')),6)),lessOrEquals(int(formatDateTime(utcNow(),'HH')),9)),greaterOrEquals(int(formatDateTime(utcNow(),'HH')),17))

 

Thank you.

Jörg

 

Hi @Joschko 

 

Glad that your query got resolved. Please continue using Fabric Community for any help regarding your queries.

NandanHegde
Super User
Super User

Hey,

You can use formatdatetime function to get the hour details :

https://learn.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions#form...

 

Something like below :

@formatDateTime( utcnow(),'hh')



----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com
avatar user

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)