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.
Solved! Go to Solution.
Hi @Anonymous ,
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
Hi @Anonymous ,
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)
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 @Anonymous ,
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