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

Announcements

News and Announcements icon
Community site session details

Community site session details

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

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)
  • Suggested answer
    Assisted by AI
    MParikh Profile Picture
    521 Super User 2026 Season 1 on at
    This symptom usually means the Patch never reaches Dataverse because Power Apps decides the call is not valid before sending it. When that happens, Monitor shows no network traffic, and Errors() often stays empty.
    Most common causes in your formula.
    1. You are patching Choice with text
      If dard_Submissionstatus is a Dataverse Choice, you cannot set it to a plain string.
    Fix:
    Use the choice record value. Pick one of these patterns based on your column.
    If it is a local choice column:
    Set:
    'dard_Submissionstatus': 'dard_Submissionstatus (Weekly Submissions)'.'Pending Approval'

    If you have the Choices table available:
    'dard_Submissionstatus': { Value: "Pending Approval" }

    The first pattern is the safest. If you patch a string into a choice, Power Apps can short-circuit without sending.
    1. You are binding lookups using Selected from a ComboBox
      For Dataverse lookups, Patch expects the full lookup record from the same table datasource, not an arbitrary object.
    Your cmbDepartment.Selected and cmbSupervisor.Selected must be records from the Departments and Employees tables that are connected as Dataverse tables in the app.
    Fix:
    Ensure the Items property of each combobox is the Dataverse table, not a collection and not AddColumns.
    Then patch the lookup column with that record.

    Example:
    'dard_Department': cmbDepartment.Selected
    'dard_Assignedmanager': cmbSupervisor.Selected

    If your Items uses a collection, do:
    'dard_Department': LookUp(Departments, departmentid = cmbDepartment.Selected.departmentid)
    'dard_Assignedmanager': LookUp(Employees, employeeid = cmbSupervisor.Selected.employeeid)
    1. Your Employee lookup returns blank
      You do:
      'dard_EmployeeID': LookUp(Employees, Email = User().Email)
    If Email is not the exact schema name, or the value does not match, LookUp returns blank. If dard_EmployeeID is required, Patch will not be sent.
    Fix:
    Add a hard guard and a visible error:

    Set(varEmp, LookUp(Employees, Email = User().Email));
    If(IsBlank(varEmp), Notify("Employee not found", NotificationType.Error); Exit());
    Then patch using varEmp.
    1. Date and Time column types
      Dataverse Time columns in Canvas apps are tricky. Your current approach converts time to text then TimeValue. That can work, but you are starting from a Time() value already. Keep it simple.
    Try:
    'dard_timefrom': DailyItem.StartTime
    'dard_timeto': DailyItem.EndTime

    If those columns are DateTime (not Time), you must combine date + time:
    'dard_timefrom': DateAdd(DailyItem.Date, Hour(DailyItem.StartTime), TimeUnit.Hours) + Time(Minute(DailyItem.StartTime), Second(DailyItem.StartTime), 0)
    1. Stop using @odata.bind for the child lookup inside Patch
      Canvas apps already support lookup assignment by passing the parent record. @odata.bind is more of a raw Web API technique.
    Fix the child patch to:
    'dard_WeeklySubmissionID': varWeeklyPlanRecord
    This is cleaner and avoids entity set string issues.
    1. Your primary key reference
      Dataverse returns the created record, and the ID field is available, but naming can be confusing. In Canvas, you often use the implicit Id field, or the primary key column.
    Test right after Patch with a label:
    Text(varWeeklyPlanRecord.dard_weeklysubmissionid)

    If that is blank, Patch failed. If it shows a GUID, move on to children.
    A working version of your submit logic
    Set(varEmp, LookUp(Employees, Email = User().Email));
    If(
    IsBlank(varEmp),
    Notify("Employee record not found for your login email.", NotificationType.Error),
    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: 'dard_Submissionstatus (Weekly Submissions)'.'Pending Approval',
    dard_SubmissionName: Text(dtpStartDate.SelectedDate, "[$-en-US]ddmmmyyyy") & " - " & User().FullName,
    dard_EmployeeID: varEmp
    }
    )
    );
    If(
        IsBlank(varWeeklyPlanRecord.dard_weeklysubmissionid),
        Notify("Failed to create weekly submission.", NotificationType.Error),
        ForAll(
            colDailyTasks As DailyItem,
            Patch(
                'Daily Entries',
                Defaults('Daily Entries'),
                {
                    dard_entryname: DailyItem.Day,
                    dard_dayofweek: DailyItem.Day,
                    dard_activity: DailyItem.Activity,
                    dard_timefrom: DailyItem.StartTime,
                    dard_timeto: DailyItem.EndTime,
                    Date: DailyItem.Date,
                    Location: DailyItem.Location,
                    dard_WeeklySubmissionID: varWeeklyPlanRecord
                }
            )
        );
        Notify("Plan submitted successfully", NotificationType.Success);
        Navigate(scrMyPlans, ScreenTransition.Fade)
    )
    )
    Fast debug steps you should do in 5 minutes
    1. Temporarily remove all fields except StartDate and SubmissionName. If network calls appear, you know one of the removed fields is blocking.
    2. Replace the choice value with the correct choice record, not text.
    3. Replace @odata.bind with direct lookup assignment to varWeeklyPlanRecord.
    4. Add the varEmp guard and verify it is not blank.
    If you paste the schema name of the choice column options (or a screenshot of the data card/choice list), I will give you the exact dard_Submissionstatus expression for your environment.
     
    Thank you! 
    Proud to be a Super User!
    📩 Need more help?
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard