This is a classic Power Apps record-context problem, and your symptoms explain it perfectly.
You’re filtering visually by two values, but your Patch / form update is only keyed on one of them — so Power Apps updates the first matching record it finds.
That’s why:
Power Apps does not automatically use the gallery selection when writing back to Excel.
✅ Why this happens
Your Excel table most likely has multiple rows with the same Attribute value:
Name Attribute RevisedValue
--------------------------------------
Power BI Name ...
Excel Name ...
Outlook Name ...
When your form saves, Power Apps effectively does something like:
LookUp(
ExcelTable,
Attribute = "Name"
)
That returns the first record where Attribute = Name, which explains exactly what you’re seeing.
🔴 Important concept
Forms do not save based on filters.
They save based on the Item record.
Right now, your form’s Item property is not uniquely identifying a row.
✅ Correct fix (this is the key)
Your EditForm.Item must reference the selected gallery record — not just a column.
✅ Set the form’s Item property to:
Gallery1.Selected
Nothing else.
No LookUp.
No Filter.
No condition.
❌ What NOT to do
These cause the exact bug you’re seeing:
LookUp(DataSource, Attribute = Gallery1.Selected.Attribute)
or
Filter(DataSource, Attribute = Gallery1.Selected.Attribute)
Because Attribute is not unique.
✅ Why this fixes everything
Gallery1.Selected contains the entire Excel row, including its internal row identity.
Power Apps then knows:
“Update THIS row — not another row with the same Attribute.”
That’s the missing piece.
✅ Final working setup
Gallery
Gallery1.Items =
Filter(
ExcelTable,
Name = Dropdown1.Selected.Name
)
Edit Form
Form.Item = Gallery1.Selected
Form.DataSource = ExcelTable
Save button
SubmitForm(Form1)
No Patch needed.
❌ Why your OnSuccess attempt didn’t work
This line:
Gallery1.Selected.Name && Gallery1.Selected.Attribute
does nothing because:
Record selection must be fixed before saving, not after.
✅ If you must use Patch instead of a form
Then your Patch must include both keys:
Patch(
ExcelTable,
LookUp(
ExcelTable,
Name = Gallery1.Selected.Name &&
Attribute = Gallery1.Selected.Attribute
),
{
RevisedValue: txtRevised.Text
}
)
But the form approach is cleaner.
🔑 Key takeaway
Excel tables do not have primary keys.
If you don’t provide a unique record reference:
Power Apps will update the first matching row it finds.
✅ Best practice (recommended)
Add a hidden column in Excel:
RowID = GUID()
Then use:
Form.Item =
LookUp(ExcelTable, RowID = Gallery1.Selected.RowID)
This guarantees correctness forever.
✅ Summary
-
Your filters are fine
-
Your labels are correct
-
The bug is caused by non-unique lookup
-
Power Apps updates the first matching row
-
Use Gallery1.Selected as the form Item
-
Or add a unique RowID column
Once you do that, the revised value will always update the correct Name + Attribute combination.