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

Team Shifts - condition based on NONE of the retrieved shifts matching displayName criteria

We use Teams Shifts for specifiying who will be on call at weekends, and the shift has a displayName of "On Call". 

 

I can already get a list of shifts between two given dates ok, but how can I check to see if there are NO shifts with a displayName of "On Call"? 

 

Basically I need a condition that says if NONE of the retrieved shifts between the given dates have a displayName of "On Call" then do x

1 REPLY 1
christopherpm
Frequent Visitor

OK, I've answered my own question. If there's a more elegant solution, please advise.

 

I've initialised a variable which I have called "OnCallCounter", and under my "List all Shifts (Preview)" step, I have inserted an "Apply To Each" using the Shifts Lists, and within this step I have a condition:-

 

If Shift Display Name is equal to On Call

Increment variable OnCallCounter by 1.

 

I then use the variable later on:-

If OnCallCounter is equal to 0

 

MyFlow.jpg

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,925)