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 / Dataverse: "Network er...
Power Apps
Unanswered

Dataverse: "Network error when using Patch function: You don't have permission to create this row."

(0) ShareShare
ReportReport
Posted on by 52

hi Expert

i am having error when i try to create a record.

Condition. 

1. if admin or super is user is creating a record they can choose for which team they are creating a record for 

2. If a team member is creating a record than the team name is automatically selected 

 

now when i am creating the record  the second patch is giving me error

 

nimesh898_0-1693713980189.png

Code: 

ClearCollect(
 DateRange,
 AddColumns(
 FirstN(
 [
 0,
 1,
 2,
 3,
 4,
 5,
 6,
 7,
 8,
 9,
 10,
 11,
 12,
 13,
 14,
 15,
 16,
 17,
 18,
 19,
 20,
 21,
 22,
 23,
 24,
 25,
 26,
 27,
 28,
 29
 ],
 DateDiff(
 varDateDetails.startDate,
 varDateDetails.endDate,
 TimeUnit.Days
 ) + 1
 ),
 "Day",
 "Day " & (Value + 1),
 "DailyDate",
 DateAdd(
 varDateDetails.startDate,
 Value,
 TimeUnit.Days
 )
 )
);
If(
 IsBlank(TextInput2) Or IsBlank(TextInput2_2) Or IsBlank(TextInput2_7) Or IsBlank(TextInput2_4) Or IsBlank(DatePicker1),
 Notify(
 "Please fill in all required fields.", 
 NotificationType.Error
 ), If(varAdminDelBtn = false,
 Set(
 varRecordsId,
 Patch(
 Records,
 If(varDateDetails.IsEdit, LookUp(Records, Id = varDateDetails.recordId), Defaults(Records)),
 {
 'Start Date': varDateDetails.startDate,
 'End Date': varDateDetails.endDate,
 'Start Time': lblStartTime.Text,
 'End Time': lblendTime.Text,
 'Booked By': User().Email,
 Name: TextInput2.Text & " " & TextInput2_7.Text,
 'Booking Date': Now(),
 'First Name': TextInput2.Text,
 'Last Name': TextInput2_7.Text,
 'Middle Name': TextInput2_12.Text,
 Gender: TextInput2_2.Text,
 'Case Number': TextInput2_4.Text,
 'In Custody Flag': TextInput2_5.Text,
 'Booking Number': TextInput2_6.Text,
 'Date Of Birth ': DatePicker1.SelectedDate,
 PodId: Value(varDateDetails.podId),
 'Booking Status': "Reserved",
 'Status (crbb3_Status)': Dropdown2,
 'Organizational Id':Dropdown5.Selected.Value,
 Comments:TextInput2_15.Text,
 Location:dpPod.Selected.'POD Name',
 IsActive: true
 }
 )
 );Notify("Room Reservation Reserved", NotificationType.Success);
 Navigate(RecordList);,

Set(
 varRecordsId,
 Patch(
 Records,
 If(varDateDetails.IsEdit, LookUp(Records, Id = varDateDetails.recordId), Defaults(Records)),
 {
 'Start Date': varDateDetails.startDate,
 'End Date': varDateDetails.endDate,
 'Start Time':lblStartTime.Text,
 'End Time':lblendTime.Text,
 'Booked By': User().FullName,
 Name: TextInput2.Text&" "&TextInput2_7.Text,
 'Booking Date': Now(),
 Comments:TextInput2_14.Text,
 Location:dpPod.Selected.'POD Name',
 'First Name': TextInput2.Text,
 'Last Name': TextInput2_7.Text,
 'Middle Name':TextInput2_13.Text,
 Gender: TextInput2_2.Text, 
 'Case Number': TextInput2_4.Text,
 'In Custody Flag': TextInput2_5.Text,
 'Booking Number': TextInput2_6.Text,
 'Booking Status':"Reserved",
 'Date Of Birth ': DatePicker1.SelectedDate,
 PodId: Value(varDateDetails.podId),
 'Organizational Id': Dropdown5_1.Selected.Value,
 'Status (crbb3_Status)':Dropdown2,
 IsActive: true
 }
 )
 ),
 ForAll(
 DateRange,
 Patch(
 'Record Histories',
 Defaults('Record Histories'),
 {
 RecordId: Value(varRecordsId.Id),
 BookedDate: DailyDate,
 PodId: Value(varDateDetails.podId),
 IsActive: true
 }
 )
);
 
 
);
If(
 varDateDetails.IsEdit,
 RemoveIf('Record Histories', RecordId = Value(varDateDetails.recordId))
);
 ForAll(
 DateRange,
 Patch(
 'Record Histories',
 Defaults('Record Histories'),
 {
 RecordId: Value(varRecordsId.Id),
 BookedDate: DailyDate,
 PodId: Value(varDateDetails.podId),
 IsActive: true
 }
 )
);
ForAll(DateRange,
 Patch(
 'Record Dates',
 If(CountRows(Filter('Record Dates', Date = DailyDate, PodId = Value(varDateDetails.podId))) > 0, LookUp('Record Dates', Date = DailyDate), Defaults('Record Dates')) ,
 {
 Date: DailyDate,
 PodId: Value(varDateDetails.podId),
 Count: CountRows(Filter('Record Histories', BookedDate = DailyDate, PodId = Value(varDateDetails.podId), IsActive))
 }
 )
);
Notify("Room Reservation Reserved", NotificationType.Success);
Navigate(
 RecordList,
 ScreenTransition.Fade
);
Reset(TextInput2);
Set(
 varAvailability,
 false
);
Reset([@dpPod]);
Reset(TextInput2_2);
Reset(TextInput2_7);
Reset(TextInput2_12);
Reset(TextInput2_6);
Reset(DatePicker1);
Reset(TextInput2_4);
Reset(dpFromDate_1);
Reset(dpToDate_1);
Reset(TextInput2_15));
Categories:
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Try to create a record in dataverse by navigating to your table in make.powerapps.com

     

    If you receive the same error, make sure you have appropriate security role to create record in this table.

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard