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