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 / Copy field value in a ...
Power Apps
Answered

Copy field value in a column to another field in another column within an gallery

(0) ShareShare
ReportReport
Posted on by 8

Hi

I would like to copy (transpose) a field value in a column to another field in another column within an editable gallery table. I have the following columns and field values within an gallery which is connected to an excel data table 'ATable':

 

RowIDCol1Col2
103
230

 

Onchange of the value (coloured red) I would like to change the blue coloured value to match. I have looked at doing this directly or indirectly via patch / forall to the excel data table but without much success (using Google, trying different formulas etc). [I am able to use the RowID to set the Displaymode so the 0s and 3 values are set to view mode so that the user can only edit the red value but now I need to build on this as described above].

 

Any ideas would be really appreciated

 

Thank you

 

 

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

    Are you wanting to change it within the same record (row) or in a different row?

  • Unitary Profile Picture
    8 on at

    I want to change the record in row-1, col-2 using the value in row-2 col-1 and patch both records

    (i.e. change the record in row-n col-m by the record in row-m by col-n where m and n = 1,2,3.....)

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

    You should be able to do this if you have the record ID for row 2.   How are you editing, do you have an editable field on top of the data field or are you using a form?

     

     

  • Unitary Profile Picture
    8 on at

    Yes, I have a record ID see the 'RowID'. Yes it is an editable table 'ATable' in a gallery. This is what I have: in TextInput for Col1 OnChange:

    Patch(ATable,LookUp(ATable,Value(RowID)=1),{Col2:TextInput_Col1.Text})) but I am struggling with how to update both records and to include a switch statement to identify the row changed.

     

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

    To identify the row changed, I would use a variable, either Set or updateContext in your text input and set the rowID.   Then on patch clear it.

     

    It seems that the UpdateIf might suit your needs for updating the records.  

     

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-update-updateif

  • Unitary Profile Picture
    8 on at

    Thank you that helped. Is this what you were thinking:

     

    UpdateIf(ATable,Value(RowID)=1,{Col2:TextInput_Col1.Text},Value(RowID)=2,{Col1:TextInput_Col1.Text})

     

    Seems slow.

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

    Yes.  That's what I was thinking.    Does it work though?   You may have to use variable values if the rows you are updating are not static, say if you want to update row 1, col2 with the value from row 3.

     

     

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 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard