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 / Form correctly showing...
Power Apps
Suggested Answer

Form correctly showing data but not correctly updating

(1) ShareShare
ReportReport
Posted on by 26
 
 
Hi all,
 
I have a form that is filtered by a dropdown (Dropdown1) and a Gallery below it (Gallery1).

The form on the right has text 
"Currently Editing : " & Gallery1.Selected.Name & " - " & Gallery1.Selected.Attribute
 
This works as expected and respects both filters. Note, "Name" is confusing as it's the field in my dropdown, but also the first Attribute.
 
 
The form also respects this (as you can see PBI appears under Original Value, and also under Name on the left, as it should.
 
I then have a field for Revised value, that should update a column in my excel.
 
This form updates correctly based on the Gallery1.Selected.Attribute but not correctly based on   Gallery1.Selected.Name
 
I.e. here I have selected Name: Power BI, and Attribute: Name, but if I update the Revised value, it will populate the Attibute:Name of the first Application it finds (Not Name: Power BI).
 
I've tried changing the OnSuccess of the form to 
Gallery1.Selected.Name && Gallery1.Selected.Attribute
 
But still no luck. Any suggestions would be appreciated.
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    2,456 Super User 2026 Season 1 on at
    Hello @JH-21011352-0
     
    The form isn’t uniquely identifying the row to update.
     
    Your form’s Item property needs to match both Name and Attribute. Otherwise Power Apps updates the first record it finds for that Attribute.
     
    Item Property:
    LookUp(
        ExcelTable, //ExcelTable - Replace with your table name
        Name = Gallery1.Selected.Name &&
        Attribute = Gallery1.Selected.Attribute
    )
    
     
    Once the form is bound to a unique record, the Revised Value will update the correct row every time.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
  • JH-21011352-0 Profile Picture
    26 on at
     
    The strange thing is that this doesn't fix it, it still updates the first record with the matching Attribute, but not Name.
     
    I've tried 
     
    LookUp(
        AppOwners, //ExcelTable - Replace with your table name
        Name = Dropdown1.Selected.Value &&
        Attribute = Gallery1.Selected.Attribute
    )
    and no luck. It's odd because the text seems to work fine.
     
  • JH-21011352-0 Profile Picture
    26 on at
    Finally fixed it.
     
    I had duplicate  __PowerAppsId__ which was causing it to update based on the first one it could find.
  • Suggested answer
    Assisted by AI
    VASANTH KUMAR BALMADI Profile Picture
    322 on at

    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:

    • the UI looks correct

    • the label shows the right Name + Attribute

    • but Excel updates the wrong row

    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:

    • && returns a Boolean

    • OnSuccess does not control record identity

    • The row has already been saved incorrectly before OnSuccess runs

    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.

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard