Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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

 

  • s44 Profile Picture
    691 on at
    Re: My data is erased when I create new ones

    Thank you so much it's work !! 

  • Verified answer
    BCBuizer Profile Picture
    22,007 Super User 2025 Season 1 on at
    Re: My data is erased when I create new ones

    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)

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,605 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,946 Most Valuable Professional

Leaderboard