Hi,
I am having issues when editing an entry in a gallery. When I select the item in the gallery to edit it displays the data. When I change and submit the data it creates a new entry in my Sharepoint list instead of editing the one I selected from the gallery.
My submit button code is
Patch('LATENT DEFECT TRACKER',
Defaults('LATENT DEFECT TRACKER'),
'Pending Latent Defect'.Updates,'Pending Latent Defect_1'.Updates);
Navigate(Success)
I have two forms I want the data to be updated with Pending Latent Defect and Pending Latent Defect_1
The code for the edit button in my gallery.
EditForm('Pending Latent Defect_1');
Navigate(
Screen2,
ScreenTransition.Cover,
{SelectedItem: Gallery3.Selected}
)
This seems to select the form I want to edit.
The properties for my gallery3 items = 'LATENT DEFECT TRACKER'
For some reason, it keeps on creating a new entry when I submit the form and not amending the original one.
Thanks in advanced
Solved! Go to Solution.
Hi @Elliottd ,
You need to tell Patch which record to update (I have assumed you are using SharePoint here)
Patch(
'LATENT DEFECT TRACKER',
{ID: Gallery3.Selected.ID},
'Pending Latent Defect'.Updates,
'Pending Latent Defect_1'.Updates
);
Navigate(Success)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hi @Elliottd ,
You need to tell Patch which record to update (I have assumed you are using SharePoint here)
Patch(
'LATENT DEFECT TRACKER',
{ID: Gallery3.Selected.ID},
'Pending Latent Defect'.Updates,
'Pending Latent Defect_1'.Updates
);
Navigate(Success)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Fantastic adding the gallery3.selected.id has worked and it now modifies the original form and does not submit a new item in my SharePoint list. Thanks for your help.