cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

Re: Edit a row of data in table using different multiple forms

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
Highlighted
Community Champion
Community Champion

Re: Edit a row of data in table using different multiple forms

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
Highlighted
Community Support
Community Support

Re: Edit a row of data in table using different multiple forms

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

Highlighted
Frequent Visitor

Re: Edit a row of data in table using different multiple forms

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?

Highlighted
Community Support
Community Support

Re: Edit a row of data in table using different multiple forms

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,578)