I have 2 collections as shown in below images.
I have applied Foreach loop, inside which I am checking If Condition which is not working. Code is as below
ForAll(
collAdditionalPassenger,
If(CountRows(Filter(collVMSFuture,Title = CPR))=0,
Patch(
'Visitor Details',
Defaults('Visitor Details'),
{ CPR: CPR,
Name:Name,
Organization:Organization,
Mobile: Mobile,
CarPassRequired: If(Lower(CarPass)="false", false, true),
CarID:CarID
}
)
)
);
Thanks for the reply @BhaskarDhone .
But the behaviour is the same even after changing the code.
If I manually check for value it works fine For ex.
If(CountRows(Filter(collVMSFuture,Title = "777777773"))=0,
but if I use runtime value it is skipping the condition
If(CountRows(Filter(collVMSFuture,Title = collAdditionalPassengerA.CPR))=0,
May be because of same column name system is getting confused
Try this
ForAll(
collAdditionalPassenger As PassengerCollection,
If(CountRows(Filter(collVMSFuture,Title = PassengerCollection.CPR))=0,
Patch(
'Visitor Details',
Defaults('Visitor Details'),
{ CPR: PassengerCollection.CPR,
Name:PassengerCollection.Name,
Organization:PassengerCollection.Organization,
Mobile: PassengerCollection.Mobile,
CarPassRequired: If(Lower(PassengerCollection.CarPass)="false", false, true),
CarID:PassengerCollection.CarID
}
)
)
);
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2