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
Super User
Super User

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

Hope this helps. Please accept if answers your question or Like if helps in any way.
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 Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (1,012)