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 :
Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Need Help on Forall and Patch Function

(1) ShareShare
ReportReport
Posted on by
Hi All,
 
Im new to Power Platform. I need help on following.
 
In my app, i'm creating multiple records and after that im creating collection of records to calculate percentage of column values on filtered rows only.
 
So, after calculating percentages for filtered rows , I want to paste calculated percentage values in their respective columns for all filtered rows in single click.
 
For that i used Forall and Patch function, But in my Sharepoint list it is pasting values in last submitted record only and not for all filtered rows.
 
request anyone to address my issue.
 
// Filter records based on the selected FrameID
ClearCollect(CollPerct, Filter('FAG Sheet Measured', FID = DataCardValue1.Text));
 
// Calculate the sums and percentages
Set(VarFAGPosSum, Sum(CollPerct, PositionScore));
Set(VarFAGFlushSum, Sum(CollPerct, FlushScore));
Set(VarFAGBothSum, Sum(CollPerct, BothScore));
Set(VarRowsCount, CountRows(CollPerct));
Set(FAGPosPerct, VarFAGPosSum / VarRowsCount);
Set(FAGFlushPerct, VarFAGFlushSum / VarRowsCount);
Set(FAGBothPerct, VarFAGBothSum / VarRowsCount);
 
// Update respective columns of all filtered rows with the calculated percentages
ForAll(
    'FAG Sheet Measured',
    Patch(LookUp('FAG Sheet Measured',FID=DataCardValue1.Text),
        { FAGPos: FAGPosPerct, FAGFlush: FAGFlushPerct, FAGBoth: FAGBothPerct }
    )
);
I have the same question (0)

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!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
11manish Profile Picture

11manish 81

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 43 Super User 2026 Season 1

#3
sannavajjala87 Profile Picture

sannavajjala87 29

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans