web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / My data is erased when...
Power Apps
Answered

My data is erased when I create new ones

(0) ShareShare
ReportReport
Posted on by 691

Hello, I'm trying to create a schedule on Power Apps by retrieving data from a Sharepoint list.
The schedule displays the days of each month and using the "previous" and "next" buttons you can move forward each month. The application retrieves various events from my SharePoint "Fournisseur" list which must be displayed on the schedule on the corresponding date.

Thanks to the form on the right of the screen, you can create a new event that will be added to the schedule (and in the SharePoint list).
But I have a problem. The problem is that, as soon as I add a new event, it deletes one !!
For example, as you can see on my screenshot below, when I add an event for "Monday 04/07/2022", it deleted the event that was indicated for "Tuesday 05/07/2022"! 
I don't understand where this problem comes from 😞 Can you help me please? Thanks in advance!

 

My SharePoint List : 

s44_0-1658915971209.png

 

DateArrivee --> Date type

Usine --> text type

Heure --> text type

 

My App :

 

Gallery2 Items :

ForAll(
 Sequence(If(DateDiff(varVideoFirstDayView; DateAdd(varVideoMonth; 1; Months); Days)>35; 42; 35));
 With({_date: DateAdd(varVideoFirstDayView; Value; Days)};
 {Value: Value;
 Items: Filter(Fournisseur; DateValue(DateArrivee) <= _date && DateValue(DateArrivee) >= _date)
 }
))

s44_1-1658916001117.png

 

Submit Button :

SubmitForm(EditForm1_1)

s44_2-1658916224395.png

 

Categories:
I have the same question (0)
  • Verified answer
    BCBuizer Profile Picture
    22,563 Super User 2026 Season 1 on at

    Hi @s44 ,

     

    It seems the FormMode you are using is FormMode.Edit, which will basically edit the selected item. In case you want to add a new Item, you need to make sure you form is in FormMode.New, which can be done with the NewForm() function.

     

    I suggest to add a button to your app ("New event") which changes the FormMode to FormMode.New:

    Button.Onselect = NewForm(EditForm1_1)

    If the User then clicks the Submit button, a new item will be created.

     

    To change back to FormMode.Edit, add the below formula to the OnSuccess property of the form:

    EditForm1_1.OnSuccess = EditForm(EditForm1_1)
  • Hii_iii Profile Picture
    691 on at

    Thank you so much it's work !! 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#2
Haque Profile Picture

Haque 69

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard