hi @Becky2210 ,
your form is creating a new item instead of updating the existing item because the Patch function is using Defaults('Disputes List 2.0') which creates a new record in the data source. To update an existing item, you need to reference the specific item you want to update.
Ensure you have a variable to store the selected item: When you navigate to the edit screen, set a variable with the item you want to edit. You can do this in the OnSelect property of the gallery or list that displays the items.
Set(varSelectedItem, ThisItem);
Edit the EditForm call: Make sure the Item property of each form is set to varSelectedItem.
Form1.Item: varSelectedItem
Form2.Item: varSelectedItem
Form3.Item: varSelectedItem
Form4.Item: varSelectedItem
Update the Submit button: Modify the OnSelect property of the submit button to update the existing item rather than creating a new one.
Patch(
'Disputes List 2.0',
varSelectedItem, // Reference the selected item to update it
Form1.Updates,
Form2.Updates,
Form3.Updates,
Form4.Updates
);
Notify("Data submitted", NotificationType.Success);
Here is the revised code for your Edit and Submit buttons:
Edit Button
Set(varSelectedItem, ThisItem);
EditForm(Form1);
EditForm(Form2);
EditForm(Form3);
EditForm(Form4);
Navigate('Non Fraud New', ScreenTransition.Fade);
Submit Button
Patch(
'Disputes List 2.0',
varSelectedItem, // Reference the selected item to update it
Form1.Updates,
Form2.Updates,
Form3.Updates,
Form4.Updates
);
Notify("Data submitted", NotificationType.Success);
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.