cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Edit a row of data in table using different multiple forms

Hi,

      I'm currently building an app which can create, modify and delete a set of data in a table (Excel file in google drive).
What I'm trying to achieve here is when I click the gallery It'll show a data from the selected row in a viewform, and there'll be a button to edit the data.

      When EDIT button is clicked, it'll navigate to another editform showing the existing answer to be edited. My table has 10 columns of questions, so I separated the questions to be edited into two different forms, but when I wanted to submit, I can only submit one form instead of two together. The other way is by using Patch to submit multiple forms, but by using this, it's creating an entire new row of data instead of saving into the existing row which I wish to edit. 

Any way to work around this ?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @rgane ,

 

Oh, sorry, this is my fault.

What I posted that the template record is set as {ID: Gallery.Selected.ID} is only suitable for SharePoint list.

In textbook way, the codes should be as follows, use lookup function to get the record you want to modify.

Patch('SP list',LookUp('SP list', 'Supplier Name'=veriGallery.Selected.'Supplier Name') ,Form1.Updates,Form2.Updates)

Best regards,

Sik

View solution in original post

4 REPLIES 4
Super User III
Super User III

I suggest you insert a gallery each on the EditForm. Then filter the gallery to divide the table containing the questions using FirstN(TableName,10) on one gallery. Then LastN(TableName,10) on another gallery. I am assuming you have 20 questions.

Then set each Edit to Gallery.Selected
Community Support
Community Support

Hi @rgane ,

 

Do you want to patch two forms to the same existing record, right?

I made a test, it work well, please check my test steps

1. Add a Gallery and two EditForm with different fields.

2. set Items property of both editform: GalleryName.Selected

3. Add a Save button, set OnSelect property: 

 

Patch('SP list',{ID:GalleryName.Selected.ID},Form1.Updates,Form2.Updates)

 

Snipaste_2020-03-11_13-50-56.png

This works well for me to patch two forms to the selected gallery record. Hope this also helps your case.

If this doesn't make sense, please share more codes and screenshots about your app.

Sik

Hi @v-siky-msft 

Your solution seems logical and make sense but I feel I'm doing something wrong, as after followed the OnSelect function you gave, the SAVE button creates a new record instead of updating the existing row with new data. I've attached my OnSelect function for my SAVE button as a image. Please do correct me if I did it wrong.

What the function says is to PATCH the table VERIFICATIONDETAILS with the COLUMN SUPPLIER NAME from the VERIGALLERY selected parent COLUMN SUPLLIER NAME. I think this is what the function means. What am I doing wrong?

Hi @rgane ,

 

Oh, sorry, this is my fault.

What I posted that the template record is set as {ID: Gallery.Selected.ID} is only suitable for SharePoint list.

In textbook way, the codes should be as follows, use lookup function to get the record you want to modify.

Patch('SP list',LookUp('SP list', 'Supplier Name'=veriGallery.Selected.'Supplier Name') ,Form1.Updates,Form2.Updates)

Best regards,

Sik

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (13,665)