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 / Network Error when usi...
Power Apps
Answered

Network Error when using Patch Function - The Specified record was not found

(0) ShareShare
ReportReport
Posted on by 1,176

Hi,

I'm getting this error when trying to Patch a record that is stored in SharePoint

ClarkyPA365_0-1680692208500.png

 This is the OnSelect formula 

Patch(
'Flight Bookings (Test)',
{ID: RecordID},
{
'Name of Requester': Plane_Requester.Text,
'Contact Number': Plane_ContactNumber.Text,
'Ward / Department': Plane_WardDept.Text,
'Cost Centre': Plane_CostCentre.Text,
'Authorising Manager': Plane_AuthMgr.Text,
'Authorising Manager email': Plane_AuthMgrEmail.Text,
'Who is Booking For?': Plane_WhoBookingfor.SelectedItems.Value,
'Departure Airport': Plane_DeptAirport.Text,
'Departure Flight Date & Time': Plane_DeptDate.SelectedDate + Time(
Value(Plane_DeptHour.Selected.Value),
Value(Plane_DeptMin.Selected.Value),
0
),
'Destination Airport': Plane_DestAirport.Text,
'Name of Travellers': Plane_Travellers.Text,
'Ticket Allocation': Plane_TktAllocation.Text,
'Airline to be Booked': Plane_BookedAirline.Text,
'Return Flight Date & Time': Plane_RtnDate.SelectedDate + Time(
Value(Plane_RtnHour.Selected.Value),
Value(Plane_RtnMin.Selected.Value),
0
),
'Same People Returning?': Plane_RtnPeople.Value,
'Additional Information': Plane_AddiInfo.Text,
'Ticket Price': Plane_TktPrice.Text,
'Booking Status': Plane_Status.Selected,
Comments: Plane_Comms.Text
}
)


I have a create form and then an selection gallery where the records are displays

ClarkyPA365_1-1680692492585.png

Which when selected, navigates to the edit form

ClarkyPA365_2-1680692584778.png



I've removed the Datasource SP site and re-connected it.  Still no luck???

 

Categories:
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @ClarkyPA365 ,

    A bit of basic debugging required here - copy all of that to NotePad, delete the patched items and then add them back in one at a time until you get an error.

  • Chris1968 Profile Picture
    1,176 on at

    Hi @WarrenBelz 

    Thank you for your prompt reply.

    I'll carry out the debugging and let you now how it goes

  • Chris1968 Profile Picture
    1,176 on at

    Hi,

    Just added in the first Patch sequence and the error message appeared.

    Patch('Flight Bookings (Test)',{ID:RecordID.},

    {Title:Plane_Title.Text

     

    })


    Would I need to add anything at the end of ID:RecordID.-----???

  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @ClarkyPA365 ,

    How do you set the Variable RecordID (your code please). I also assume all those source references are valid control (text box, drop-down/date picker etc) names.

  • SimnaJ Profile Picture
    205 on at

    Try this
    Patch('Flight Bookings (Test)',{ID:RecordID},

    {Title:Plane_TitleControlName.Text})

  • Chris1968 Profile Picture
    1,176 on at

    Hi @WarrenBelz 

    I've set the variable in the gallery, OnSelect 

    Set(varTrain,ThisItem);Navigate(TrainEdit_srn)  (varPlane for Flight Ticket)



    ClarkyPA365_0-1680778069152.png

     This is the formula for my  Save button 

    Patch(
        'Flight Bookings (Test)',
        {RecordID:Plane_RecordID},
        {
            Title: Plane_Title.Text,
            'Name of Requester': Plane_Requester.Text,
            'Contact Number': Plane_ContactNumber.Text,
            'Ward / Department': Plane_WardDept.Text,
            'Cost Centre': Plane_CostCentre.Text,
            'Authorising Manager': Plane_AuthMgr.Text,
            'Authorising Manager email': Plane_AuthMgrEmail.Text,
            'Who is Booking For?': Plane_WhoBookingfor.SelectedItems.Value,
            'Departure Airport': Plane_DeptAirport.Text,
            'Departure Flight Date & Time': Plane_DeptDate.SelectedDate + Time(
                Value(Plane_DeptHour.Selected.Value),
                Value(Plane_DeptMin.Selected.Value),
                0
            ),
            'Destination Airport': Plane_DestAirport.Text,
            'Name of Travellers': Plane_Travellers.Text,
            'Ticket Allocation': Plane_TktAllocation.Text,
            'Airline to be Booked': Plane_BookedAirline.Text,
            'Return Flight Date & Time': Plane_RtnDate.SelectedDate + Time(
                Value(Plane_RtnHour.Selected.Value),
                Value(Plane_RtnMin.Selected.Value),
                0
            ),
            'Same People Returning?': Plane_RtnPeople.Value,
            'Additional Information': Plane_AddiInfo.Text,
            'Ticket Price': Plane_TktPrice.Text,
            'Booking Status': Plane_Status.Selected,
            Comments: Plane_Comms.Text
        }
    )

    If I make any changes to the record it creates another record in the SharePoint list???
  • WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    @ClarkyPA365 ,

    But how do you set RecordID ? If your code

    Patch(
     'Flight Bookings (Test)',
     {ID: RecordID},
     {Title: Plane_Title.Text}
    )

    produces an error (as you have stated) there are only three possibilities: - 

    • RecordID is not a number
    • Title is not a Text field
    • Plane_Title is not a Text control

    This is why I send you on the debugging journey - you have an incorrect reference somewhere and it should be easy to find.

  • Chris1968 Profile Picture
    1,176 on at

    Hi,

    I've changed the code slightly.  See recent post

    The ID was the default ID column that comes with SharePoint so I added in another column called RecordID and a label to my app called Plane_RecordID.  which increments the Record ID +1

    From the gallery, there are a number of records with the same title so I don't get the 'Network' error anymore but when I make changes to the record it doesn't 'Patch' that record it creates a new record??

    ClarkyPA365_0-1680781203632.png

     

  • Chris1968 Profile Picture
    1,176 on at

    Hi,

    Think I've resolved the issue..

    Finally sorted out the variable 😊

    ClarkyPA365_0-1680793976849.png



    ClarkyPA365_1-1680794022228.png

     




  • Verified answer
    WarrenBelz Profile Picture
    156,528 Most Valuable Professional on at

    Hi @ClarkyPA365 ,

    The invalid part was the ID ?

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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard