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 / Patch, Collect, Update...
Power Apps
Unanswered

Patch, Collect, UpdateIf - To update items on a SharePoint list from a collection?

(0) ShareShare
ReportReport
Posted on by 48

I have a canvas app, where the user can update single records, and everything works fine. However I'm having issues with updating multiple items with the user's inputted data.

 

I have a gallery with a check box and OnCheck have the below (using Remove OnUncheck):

 

Collect(
colDataTEXT,
{
Title: ThisItem.'Srvc Order Unit',
ForecastYear: ForecastYEAR_Forecasted.Text,
ForecastMonth: ForecastMONTH_Forecasted.Selected.Month,
ForecastComments: ForecastCOMMENTS_Forecast.Text,
WHO: ForecastWHO_Forecasted.Selected.Value,
WHY: ForecastWHY_Forecasted.Selected.Value,
Forecast: FORECAST_Forecasted.Selected.Value,
field_25: ThisItem.ccm_full_name,
field_38: ThisItem.Customer_Name,
field_75: ThisItem.'Order Number',
field_106: ThisItem.'Srvc Order Unit',
field_23: ThisItem.ccm_full_name
}
)

 

And then on a submit button I have the following:

 

Collect(
<SharePointLISTNAME>,    ----- Target sharepoint list, works if this is the same as the list in the gallery and when it isn't
colDataTEXT                       ----- Name of the collection that the item in the gallery is added to when the checkbox is ticked.
);
Clear(colDataTEXT);
Set(
IsClear_Forecasted,         ------ Rest variable on the checkbox within the gallery
false
);
Set(
IsClear_Forecasted,
true
)

 

(The Set part is to uncheck the checkbox in the gallery which has Reset = IsClear_Forecasted)

 

This adds the items in the collection to the SharePoint list, but doesn't update the records and creates new ones - It also adds the items within the collection to other SharePoint lists. But how can I update the item, since all items already appear on the the target SharePoint lists - each entry is unique within the entry in the Title column:

 

Title: ThisItem.'Srvc Order Unit'

 

I use Patch elsewhere in the application to update items in different SharePoint lists but this is one item each action:

 

Patch(
<SharePointLISTNAME>,
LookUp(
<SharePointLISTNAME>,
'Srvc Order Unit' = VarForecasted.'Srvc Order Unit'
),
{Installed: DatePicker2_1.SelectedDate,
Forecast: "Installed"}
);

 

Any suggestions?

Categories:
I have the same question (0)
  • mmbr1606 Profile Picture
    14,615 Super User 2026 Season 1 on at

    hey @ScottinPoland 

     

    can u try this please:

    ForAll(
     colDataTEXT,
     Patch(
     <SharePointLISTNAME>, 
     LookUp(
     <SharePointLISTNAME>, 
     'Srvc Order Unit' = Title
     ),
     {
     ForecastYear: ForecastYear,
     ForecastMonth: ForecastMonth,
     ForecastComments: ForecastComments,
     WHO: WHO,
     WHY: WHY,
     Forecast: Forecast,
     field_25: field_25,
     field_38: field_38,
     field_75: field_75,
     field_106: field_106,
     field_23: field_23
     }
     )
    );
    Clear(colDataTEXT);
    Set(IsClear_Forecasted, false);
    Set(IsClear_Forecasted, true);
    

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • ScottinPoland Profile Picture
    48 on at

    Unfortunately that didn't work. Got an error with fetching data.

    ScottinPoland_0-1714722348681.pngScottinPoland_1-1714722425325.png

     

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard