cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mo_Islam
Helper III
Helper III

Bulk Patch to Dataverse issue

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?

2 REPLIES 2
dpoggemann
Resident Rockstar
Resident Rockstar

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

Mo_Islam
Helper III
Helper III

@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
        }
    )
);



Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,189)