Hi,
For some reason the Patch ForAll is not creating the records properly. It omits some data.
e.g.
I have the following to create an event for multiple people selected:
ForAll(
galEvents_grp.AllItems,
Patch(
TimetableDB,
Defaults(TimetableDB),
{
Category: CategorySelector_group.Selected.Value,
EventName: If(CategorySelector_group.Selected.Value="Weekend", "Weekend",toptxtCourse_group.Text),
TeacherName: txtName_grp.Text,
CourseTeacher: txtName_grp.Text,
EventStart: If(cat_label.Text="Training" Or cat_label.Text="Other", dp_events_grp.SelectedDate + Time(Value(ddStartHour_grp.Selected.Value),Value(ddStartMinutes_grp.Selected.Value),0), dp_events_grp.SelectedDate + Time(0, 0, 1)),
EventEnd: If(cat_label.Text="Training" Or cat_label.Text="Other", dp_events_grp.SelectedDate + Time(Value(ddEndHour_grp.Selected.Value),Value(ddEndMinutes_grp.Selected.Value),0), dp_events_grp.SelectedDate + Time(23, 59, 0)),
TeacherEmail: Lower(lblEmail_grp.Text),
Centre: lblCentre_grp.Text
}
)
);
UpdateContext({disableTeacher:false});
UpdateContext({ResetCheckbox:true});
UpdateContext({ResetCheckbox:false});
Set(successMessage,"Added successfully");
Clear(colHolidaybyTeacher);
Clear(colHolidayDates);
Clear(colTeacher4Holiday);
Navigate(SuccessScreen)
When I had the App over with SharePoint, it worked fine, but ever since migrating it to Teams (Dataverse), it omits the Date & Time columns for about half of the records. It does create an entry but only half the data is entered to the data table.
Any thoughts?
Hi @Mo_Islam.,
I would try a couple things:
1. Check your definitions on your date fields in the Dataverse, do you have them with User Local or Time Zone Independent? This would be a difference from what you would have in SharePoint for the field definition.
2. Did you try running with hard coded dates for the records on the event start and end and see if they work successfully for all records?
3. Are the dates not populating only when a specific condition is met (i.e. when not Training or Other)?
Thanks,
Drew
@dpoggemann Thank you for your reply.
I have checked everything, and since then have made some changes around the date/time. I now have a DATE ONLY field, and the time is stored as text.
Even doing so, the FORALL Patch only does the first 18 records with full filed info, but omits data for the rest of them - however still creates a record.
This is my new formual:
ForAll(
galEvents_grp.AllItems,
Patch(
TimetableDB,
Defaults(TimetableDB),
{
Category: CategorySelector_group.Selected.Value,
EventName: If(CategorySelector_group.Selected.Value="Weekend", "Weekend",toptxtCourse_group.Text),
TeacherName: txtName_grp.Text,
CourseTeacher: txtName_grp.Text,
EventDate_Main: dp_events_grp.SelectedDate,
TimeStart_Main: If(cat_label.Text="Training" || cat_label.Text="Other", Text(ddStartHour_grp.Selected.Value &":"& ddStartMinutes_grp.Selected.Value), Text("00:00")),
TimeEnd_Main: If(cat_label.Text="Training" || cat_label.Text="Other", Text(ddEndHour_grp.Selected.Value &":"& ddEndMinutes_grp.Selected.Value), Text("23:59")),
TeacherEmail: Lower(lblEmail_grp.Text),
Centre: lblCentre_grp.Text
}
)
);
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
17 | |
11 | |
9 | |
6 | |
4 |
User | Count |
---|---|
24 | |
18 | |
18 | |
15 | |
11 |