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

Notifications

Announcements

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

News and Announcements

Season of Giving Solutions is Here!

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

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

#1
iampranjal Profile Picture

iampranjal 67

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 37 Super User 2025 Season 2

#3
Pallavi Phade Profile Picture

Pallavi Phade 24

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans