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

Checking if all subtasks are complete

I need something similar to this where it checks to see if a record exists.

 

https://powerusers.microsoft.com/t5/General-Discussion/Checking-to-see-if-a-Record-exists-if-it-does...

 

I have a situation where multiple people are assigned subtasks to a major task, and it can't be marked approved until all people have performed the task.  

 

Here is what I am using.

 

If(LookUp(Filter(MOC_Approvals,vID.ID='MOC ID'),Status="Approved",true)<>true,UpdateContext({vSuperCheck:false}),UpdateContext({vSuperCheck:true}));

 

The problem I realized this morning is that lookup will return a true on the first item marked approved, but I need it do something like a ForAll.  Any ideas?

1 ACCEPTED SOLUTION

Accepted Solutions
Mike8
Memorable Member
Memorable Member

Hello,

If(
!LookUp(Filter(MOC_Approvals,vID.ID='MOC ID'),!(Status="Approved"),true),
UpdateContext({vSuperCheck:false}),UpdateContext({vSuperCheck:true}));

Can you try the formula above?
It checks if there is a record that its status is not approved. If it exists does nothing. If it doesn't find any records that status is not approved means that all are approved 🙂
Hope it works

View solution in original post

2 REPLIES 2
Mike8
Memorable Member
Memorable Member

Hello,

If(
!LookUp(Filter(MOC_Approvals,vID.ID='MOC ID'),!(Status="Approved"),true),
UpdateContext({vSuperCheck:false}),UpdateContext({vSuperCheck:true}));

Can you try the formula above?
It checks if there is a record that its status is not approved. If it exists does nothing. If it doesn't find any records that status is not approved means that all are approved 🙂
Hope it works

bjdshp
Frequent Visitor

Thanks for pointing out the obvious!  That worked, I appreciate the help.

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,541)