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 / Data in cell is not ch...
Power Apps
Unanswered

Data in cell is not changing

(0) ShareShare
ReportReport
Posted on by 49

Hello everyone

M trying to make small store app, but faced a problem

I want to open detailed info from gallery and then by clicking a button change quantity of chosen item.gfdbxc.JPG

When m trying this formula, data change only in first line in table, others no any change,

when m trying this formula it not modificates cells but create new line with value in qty cell

 

Patch(Table1;Gallery1.Selected; {qty: Value(Gallery1.Selected.qty) + Value(TextInput1.Text)})

 

Please advice how to make it change any selected line

Categories:
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    It's creating a new line because you told it to.  You need to modify it something like this, replacing 'SomeField' and 'MatchingField' with the name of the column in Table1 and Gallery1 that match to identify the record to update:

     

    Patch(Table1; Table1.SomeField = Gallery1.Selected.MatchingField; {qty: Value(Gallery1.Selected.qty) + Value(TextInput1.Text)})

      

  • Alexey_bot Profile Picture
    49 on at

     

    Patch(Table1;Table1.qty = Gallery1.Selected.qty; {qty: Value(Gallery1.Selected.qty) + Value(TextInput1.Text)}) 

     

    I did like this, column name is qty gallery is connected to Table 1 and field in Gallery 1 is the same qty, but it gives me error that patch formula is wrong, may be i didn't understand you correctly please advice

    Error is cannot compare Table, Text

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Does your patch statement have any red lines under it?   If you hover over it, you will see error messages popup.   What do they say?

     

    Screenshots are very helpful.

  • Alexey_bot Profile Picture
    49 on at

    incompatible types for comparison. There is no way to compare these types: Table, text

    Untitled.jpg

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

     You don't want to use your qty column as an ID reference.  Patch needs to know what record to udpate, so you have to have use a unique value such as the ID column.

     

    Patch(Table1;Table1.ID = Gallery1.Selected.ID; {qty: Value(Gallery1.Selected.qty) + Value(TextInput1.Text)}) 
  • Alexey_bot Profile Picture
    49 on at

    Do you mean excel ID column as A,B,C and etc? and ID should be the same for Table and Gallery1?

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    In order to update existing items you have to be able to identify the item you want to update.   So you need a unique identifier that can match your updates to the item you want to update.

     

    And yes if you are initially updating a table and from there updating excel, you will need that ID in all 3 places.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard