web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch to Dataverse Tab...
Power Apps
Unanswered

Patch to Dataverse Tables Not Executing - (Canvas App with Parent-Child Relationship)

(0) ShareShare
ReportReport
Posted on by 9
Hi Power Apps community,
The app allows users to create weekly plans with daily entries, stored in Dataverse tables. I've been debugging an issue where Patch operations don't seem to execute remotely—Monitor shows no network calls to the tables, even though the formula evaluates client-side without syntax errors.

Background and Setup:
- Tables Involved:
  - Weekly Submissions (logical name: `dard_weeklysubmission`, entity set: `dard_weeklysubmissions`, primary key: `dard_weeklysubmissionid`)
    - Columns: `dard_StartDate` (Date), `dard_EndDate` (Date), `dard_Department` (Lookup to Departments), `dard_Assignedmanager` (Lookup to Employees), `dard_Submissionstatus` (Choice: "Pending Approval"), `dard_SubmissionName` (Text), `dard_EmployeeID` (Lookup to Employees).
  - **Daily Entries** (logical name: `dard_dailyentry`, entity set: `dard_dailyentries`)
    - Columns: `dard_entryname` (Text), `dard_dayofweek` (Text), `dard_activity` (Text), `dard_timefrom` (Time), `dard_timeto` (Time), `Date` (Date), `Location` (Text), `dard_WeeklySubmissionID` (Lookup to Weekly Submissions).

- **App Flow:**
  - On a "New Weekly Plan" screen, users select start/end dates, department, supervisor.
  - "Next" button (OnSelect): Validates inputs, sets `varWeeklyPlan` variable, generates a local collection `colDailyTasks` with 5 rows (Monday-Friday, default times/activity/location using ForAll/Sequence).
  - Navigates to "Daily Tasks" screen (gallery-like with text inputs for editing colDailyTasks).
  - "Submit for Approval" button (OnSelect): Patches to Weekly Submissions (parent), then ForAll to patch Daily Entries (children) linked via @odata.bind.

**The Next Button Code (works fine, no issues):**
```powerapps
If(
    !IsBlank(dtpStartDate.SelectedDate) &&
    !IsBlank(dtpEndDate.SelectedDate) &&
    !IsBlank(cmbDepartment.Selected) &&
    !IsBlank(cmbSupervisor.Selected) &&
    dtpStartDate.SelectedDate <= dtpEndDate.SelectedDate &&
    DateDiff(dtpStartDate.SelectedDate, dtpEndDate.SelectedDate) <= 6,

    Set(
        varWeeklyPlan,
        {
            StartDate: dtpStartDate.SelectedDate,
            EndDate: dtpEndDate.SelectedDate,
            Department: cmbDepartment.Selected,
            Supervisor: cmbSupervisor.Selected,
            Status: "Draft",
            Employee: User().FullName,
            EmployeeEmail: User().Email
        }
    );

    ClearCollect(
        colDailyTasks,
        ForAll(
            Sequence(5),
            {
                Day: Text(DateAdd(dtpStartDate.SelectedDate, Value - 1, TimeUnit.Days), "[$-en-US]dddd"),
                Date: DateAdd(dtpStartDate.SelectedDate, Value - 1, TimeUnit.Days),
                StartTime: Time(7, 45, 0),
                EndTime: Time(16, 15, 0),
                Activity: If(
                    Weekday(DateAdd(dtpStartDate.SelectedDate, Value - 1, TimeUnit.Days), StartOfWeek.Monday) = 5,
                    "Wrap-up tasks",
                    ""
                ),
                Location: "Type your location"
            }
        )
    );

    Navigate(scrMyPlans1, ScreenTransition.Fade),

    Notify(
        If(
            dtpStartDate.SelectedDate > dtpEndDate.SelectedDate, "Start date must be before end date.",
            DateDiff(dtpStartDate.SelectedDate, dtpEndDate.SelectedDate) > 6, "Plan should be for one week max.",
            "Please complete all required fields."
        ),
        NotificationType.Error
    )
)
```

**The Submit Button Code (OnSelect) - This is where the issue is:**
```powerapps
If(
    !IsBlank(dtpStartDate.SelectedDate) &&
    !IsBlank(dtpEndDate.SelectedDate) &&
    !IsBlank(cmbDepartment.Selected) &&
    !IsBlank(cmbSupervisor.Selected) &&
    dtpStartDate.SelectedDate <= dtpEndDate.SelectedDate,

    Set(
        varWeeklyPlanRecord,
        Patch(
            'Weekly Submissions',
            Defaults('Weekly Submissions'),
            {
                'dard_StartDate': dtpStartDate.SelectedDate,
                'dard_EndDate': dtpEndDate.SelectedDate,
                'dard_Department': cmbDepartment.Selected,
                'dard_Assignedmanager': cmbSupervisor.Selected,
                'dard_Submissionstatus': "Pending Approval",
                'dard_SubmissionName': Text(dtpStartDate.SelectedDate, "[$-en-US]ddmmmyyyy") & " - " & User().FullName,
                'dard_EmployeeID': LookUp(Employees, Email = User().Email)
            }
        )
    );

    If(
        !IsBlank(varWeeklyPlanRecord.'dard_weeklysubmissionid'),
        ForAll(
            colDailyTasks As DailyItem,
            Patch(
                'Daily Entries',
                Defaults('Daily Entries'),
                {
                    'dard_entryname': DailyItem.Day,
                    'dard_dayofweek': DailyItem.Day,
                    'dard_activity': DailyItem.Activity,
                    'dard_timefrom': TimeValue(Text(DailyItem.StartTime)),
                    'dard_timeto': TimeValue(Text(DailyItem.EndTime)),
                    'Date': DailyItem.Date,
                    'Location': DailyItem.Location,
                    'dard_WeeklySubmissionID@odata.bind': "/dard_weeklysubmissions(" & varWeeklyPlanRecord.'dard_weeklysubmissionid' & ")"
                }
            )
        );

        Notify("Plan submitted successfully", NotificationType.Success);
        Navigate(scrMyPlans, ScreenTransition.Fade),

        Notify("Failed to create weekly plan record", NotificationType.Error)
    ),

    Notify("Please complete all required fields and ensure start date ≤ end date", NotificationType.Error)
)
```

Issue Details:
- When pressing Submit, the formula evaluates (UI updates like Notifies work if validation fails).
- But Monitor (Network category) shows **no HTTP requests** to `dard_weeklysubmissions` or `dard_dailyentries`—no POST/PATCH at all.
- Parent Patch seems to "run" but `varWeeklyPlanRecord.'dard_weeklysubmissionid'` is blank (condition fails, skips children).
- Using Errors('Weekly Submissions') after Patch shows no entries, but no record is created in Dataverse.
- Tested minimal Patch (just parent) — still no network call, no GUID.
- Collection edits (on daily screen) work locally (LookUp/Patch to colDailyTasks succeed).

What I've Tried:
- Confirmed entity set names from OData (`dard_weeklysubmissions`, `dard_dailyentries`).
- Used `@odata.bind` with correct schema/logical names (no syntax errors).
- Added TimeValue() for time fields to force type.
- Checked permissions: User has Create on both tables.
- Monitor shows client-side LookUp/ForAll but no network.

Questions:
- Why is Patch not triggering network calls? Is it silent client-side validation fail?
- Could required columns be missing (e.g., system fields like ownerid/statecode)?
- Any known bugs with lookups in Patch or @odata.bind in canvas apps?


Best,  
S'phesihle
Screenshot 2026-02-02 124158.png
Screenshot 2026-0...

Your file is currently under scan for potential threats. Please wait while we review it for any viruses or malicious content.

I have the same question (0)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 460

#2
WarrenBelz Profile Picture

WarrenBelz 381 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 330 Super User 2025 Season 2

Last 30 days Overall leaderboard