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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

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.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (3,879)