cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mariam
Level: Powered On

How to copy one value from one row to another field in the next row in powerapps gallary?

I have inventory data that is displaied in powerapps gallary. The end of month inventory = the begining inventory next month. the powerapps gallary is linked to SQL table. How to have a buttom when I click it copy the value from last row into the value in the next row?

 

powerapps.JPG

2 REPLIES 2
Community Support Team
Community Support Team

Re: How to copy one value from one row to another field in the next row in powerapps gallary?

Hi @Mariam ,

 

Do you want to cope the previous’s month’s Inventory EOM to next month’s Inventory BOM?

I think the patch function with the button control can help you to achieve that.

Please try the following workaround, I test as next:

Data Source:

20190308copyonevaluetonewfield1.png

App Test:

Gallery1.Items: '[dbo].[Table_20190308TEST1]'          ('[dbo].[Table_20190308TEST1]'  is my sql table name        )

Add one button,and rename it Button_Patch,Button_Patch.OnSelect: Patch('[dbo].[Table_20190308TEST1]',Defaults('[dbo].[Table_20190308TEST1]'),{ID:Value(TextInput_ID.Text),FP:TextInput_Date.Text,IE:Value(TextInput_IE.Text),IB:Last('[dbo].[Table_20190308TEST1]').IE})       (textinput control are used to input other values,you can choose to use them or not) 

20190308copyonevaluetonewfield2.jpg

 

Result Test: 

 

20190308copy one value from one row to another fieldgif1.gif

 

 

Best Regards.

Yumia

Mariam
Level: Powered On

Re: How to copy one value from one row to another field in the next row in powerapps gallary?

Hi, 

thank you for the sugession. The only different in my scenario is that I'm updating the data within the gallary. I tried to apply the same logic but it did not work