web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Forall with Filter - A...
Power Apps
Answered

Forall with Filter - Avoid Duplication

(0) ShareShare
ReportReport
Posted on by 538

Experts,

 

The goal is to prevent delivering duplicate data to the table from the collection.
As a result, I'm attempting to exclude the collection row if it has  value 4 in statusc column.
My formula is as follows:

 

Collection : DailyinventoryL

Table : Dailyinventory

 

---------------------

Collection view :

 

AVTS_1-1654201757935.png

 

 

 

------------

 

 

According to the formula below, Forall formula should eliminate column sno 1 and 2 since they have status 4 and the remaining row like sno3 which status is blank  should be sent to the table.

 

--------------

 

ForAll( Filter(DailyinventoryL, Not(4 in DailyinventoryL.statusc )),

Patch(
Dailyinventory,
Defaults(Dailyinventory),
{
crf99_materialno: Materialno,
crf99_materialdesc: Materialdesc,
crf99_plant: plant,
crf99_qty: Qty,
crf99_bbd: BBD
}
)


);

Set(
varNotifytest9,
"Transmit Completed"
);
Set(Varlastno1 ,
First(
FirstN(Sort(DailyinventoryL,sno, Descending),
1
)
).sno);

UpdateIf(DailyinventoryL, 'Created On' = Today() , {statusc: 4});

 

above formula is not working as expected. Friends please your thoughts. 

Categories:
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    You should move your forall to inside of your patch. 

     

    Here is an example using clearcollect.

     

    I have a gallery, and the items are just the default example items.

    I mad e abutton and set its onselect to 

    ClearCollect(ExampleForAll,
     ForAll(
     Filter(Gallery4.AllItems,
     SampleHeading<>"Lorem ipsum 2"),ThisRecord))

    This will collect all the records that don't match Lorem ipsum 2. You should be able to get there using this as an example

  • AVTS Profile Picture
    538 on at

    Thank u 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard