I have a Power App that is connected to several SQL Databases for Lookups but also saves in a separate Database/table.
For some reason it appears when the end users edit a record, they can save it and it then disappears/deletes from the database. The only way I have noticed that is that the ID skips. For example Record ID 364,365,366 then it goes to 368 making me assume we are losing rows.
I use the current formulas:
Display Screen
Edit Icon on Select: EditForm(EditForm);Navigate(EditDeskJournal,ScreenTransition.None)
EditScreen
Items are set to= Gallery1.Selected
Submit Icon (I have tried a couple of things)
I am not sure if there is something wrong with the formula of it not saving or if I am missing another step. Whenever I do a test I have no issues with the data being removed/deleted.
Thanks in advance!
@v-xida-msftThank you for getting back to me. I checked on the OnSuccess, I have no remove formula there. I added the EditForm.Updates but I am still losing data. I am missing 4 out of 125 entries which is better than before. Could there be another reason why SQL may "skip" an ID? Could there be an issue with multiple people submitting an entry at the same time? Thank you.
Hi @Melinda ,
Have you put some Remove formula within the OnSuccess property of the Edit form in your app?
Based on the formula you provided, I could not find any formula which is used to remove/delete record from your table. Please check if you have added a Remove formula within the OnSuccess property of the Edit form, when your submit your form data successfully, the OnSuccess property of the Edit form would be fired.
In addition, please consider take a try with the following workaround:
Set the Items property of the ComboBox to following:
SortByColumns(Filter(Lookup_Database',Filter1=Value),Column,Ascending)
Set the DefaultSelectedItems property of the ComboBox to following:
If(
EditForm.Mode = FormMode.Edit,
Filter(Lookup_Database, Column = Gallery1.Selected.Column).Column
)
or
{
Column: Gallery1.Selected.Column
}
Set the OnSelect property of the "Submit" button to following:
If(
EditForm.Mode = FormMode.Edit,
Patch(
Main_Database,
Gallery1.Selected,
EditForm.Updates
),
Patch(
Main_Database,
Defaults(Main_Database),
EditForm.Updates
)
);
ResetForm(EditForm);
Back()
In addition, please also check if you set up a ms flow to delete the record from your table when a record is modified.
If the issue still exists, please consider re-generate a new app based on your table data source, then configure the combobox data cards in your Edit form, then try the app again, check if the issue is solved.
Best regards,
WarrenBelz
110
Most Valuable Professional
MS.Ragavendar
81
stampcoin
54