Objective:
- Filter Data: Collect records from the
Capacity_datasetwhere:- I compare it against two selected values (
DateFrom.Selected.ValueandDateTo.Selected.Value).
- I compare it against two selected values (
- Further Filter: Filter the results by the selected
Operation. - Final Collection: Create a collection
FilteredTableFinalcontaining records from the originalCapacity_datasetwhere theEntry_IDmatches the filtered results. - Update Excel: Use a
ForAllloop withPatchto update theOEE_Adjustedfield for all matching rows in theCapacity_dataset.
Code I'm Using:
// Step 1: Filter and Collect Data
ClearCollect(
FilteredTable,
Filter(
Capacity_dataset,
Value(Year_Month) >= Value(DateFrom.Selected.Value) &&
Value(Year_Month) <= Value(DateTo.Selected.Value)
)
);
ClearCollect(
FilteredTable1,
Filter(
FilteredTable,
Operation = SelectOperation.Selected.Value
)
);
ClearCollect(
FilteredTableFinal,
Filter(
Capacity_dataset,
Entry_ID in FilteredTable1.Entry_ID
)
);
// Step 2: Update Data Using Patch
ForAll(
FilteredTableFinal,
Patch(
Capacity_dataset,
ThisRecord, // Attempting to update the filtered records
{ OEE_Adjusted: Value(TextInput1.Text) }
)
)
The Issues I'm Facing:
- Only the First Record is Updated:
- Despite filtering correctly, only the first available row matching the
Operationgets updated.
- Despite filtering correctly, only the first available row matching the
- Date Filters Ignored:
- The update seems to ignore the date range (
DateFromandDateTo) completely.
- The update seems to ignore the date range (
- Wrong Placement of Data:
- The updated value gets placed in the first available row with the selected
Operation, not the correctly filtered rows.
- The updated value gets placed in the first available row with the selected
What I Need Help With:
- Why does the
Patchfunction only update the first record and ignore the filtered data? - How can I ensure all filtered rows are updated correctly in Excel Online using Power Apps?
- Is there a known limitation with the Excel connector when using
ForAllandPatchtogether? - Any insights into whether
ThisRecordloses connection to the original data source after filtering?

Report
All responses (
Answers (