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?