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 :
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)
}
))
Submit Button :
SubmitForm(EditForm1_1)
Thank you so much it's work !!
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)
WarrenBelz
146,605
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,946
Most Valuable Professional