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
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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (5,218)