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 / Problem updating Share...
Power Apps
Unanswered

Problem updating SharePoint List using ForAll/Patch

(0) ShareShare
ReportReport
Posted on by 68

Hi Community, 

I have an issue updating my SP List using ForAll and Patch. Expression below:

 

ForAll(
 colRiskRegisterAdd,
 Patch(
 RiskRegister,
 Defaults(RiskRegister),
 {
 RiskID: ThisRecord.ID,
 RiskGroup: ThisRecord.RiskGroup,
 Risk: ThisRecord.Risk,
 RiskCategory: ThisRecord.RiskCategory,
 RiskDescription: ThisRecord.RiskDescription,
 MonetaryImpact: numMonetaryImpact.Text,
 ReputationalImpact: numReputarionalImpact.Text,
 OperationalImpact: numOperationalImpact.Text,
 FinalImpactScore: numFinalImpactScore.Text,
 Likelihood: numLikelihood.Text,
 InherentRisk: numInherentRisk.Text,
 ControlEffectiveness: numControlEffectiveness.Text,
 ResidualRisk: numResidualRisk.Text 
 }
 )
);

 

The issue I face is the ForAll adds each Record as expected but adds the last entered set of numerical values to all records. What do i need to do to ensure that each record is updated with the corresponding set of numerical values.  Capture.PNG

 Thanks

 

Categories:
I have the same question (0)
  • notj Profile Picture
    782 on at

    @marsdendd OK, so what's the issue/error?

  • marsdendd Profile Picture
    68 on at

    The ForAll adds each Record as expected but adds the last entered set of numerical values. So when adding more than one record the same set of numerical values are updated to all records.

     

    I understand the ForAll isnt a loop in the traditional sense but id appreciate any help on how to ensure the values are correctly written to the corresponding item.

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    HI @marsdendd ,

    Assuming all these fields are in the Collection, this should work

    ForAll(
     colRiskRegisterAdd As aRisk,
     Patch(
     RiskRegister,
     Defaults(RiskRegister),
     {
     RiskID: aRisk.ID,
     RiskGroup: aRisk.RiskGroup,
     Risk: aRisk.Risk,
     RiskCategory: aRisk.RiskCategory,
     RiskDescription: aRisk.RiskDescription,
     MonetaryImpact: aRisk.numMonetaryImpact,
     ReputationalImpact: aRisk.numReputarionalImpact,
     OperationalImpact: aRisk.numOperationalImpact,
     FinalImpactScore: aRisk.numFinalImpactScore,
     Likelihood: aRisk.numLikelihood,
     InherentRisk: aRisk.numInherentRisk,
     ControlEffectiveness: aRisk.numControlEffectiveness,
     ResidualRisk: aRisk.numResidualRisk
     }
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    Hi @marsdendd 

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • marsdendd Profile Picture
    68 on at

    Hi @WarrenBelz 

     

    Thanks for coming back on this. Sorry for my late reply. I wasn't alerted until today that there had been a response. 

     

    Ok so i tried the proposed solution and unfortunately it didn't have the desired outcome. 

     

    The inclusion of the following in the collection returns a "The type of this argument does not match the expected type "Text" (tried changing SP list column to number and got similar error except type "Number")

     

    MonetaryImpact: aRisk.numMonetaryImpact,
    ReputationalImpact: aRisk.numReputarionalImpact,
    OperationalImpact: aRisk.numOperationalImpact,
    FinalImpactScore: aRisk.numFinalImpactScore,
    Likelihood: aRisk.numLikelihood,
    InherentRisk: aRisk.numInherentRisk,
    ControlEffectiveness: aRisk.numControlEffectiveness,
    ResidualRisk: aRisk.numResidualRisk

     

    Darren

  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    @marsdendd ,

    Where are the values you have noted as Text coming from? I assumed they were fields in the collection.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard