Skip to main content
Community site session details

Community site session details

Session Id : Z4x5ixXdsrcZcoqf+J0CNb
Power Apps - Microsoft Dataverse
Answered

Network error when using patch

Like (0) ShareShare
ReportReport
Posted on 6 Mar 2024 12:09:22 by 430 Moderator

Hello - this is driving me completely insane and I'm hoping you can help!

 

I am developing a comparatively simple canvas app using Dataverse as the source. Tables are:
Orders - simple header information

Order Lines - a many-to-one relationship to Orders, plus a part number and a line number

Picked Items - a many-to-one relationship to Order Lines, plus a serial number of the picked item

 

It generally runs as expected, but when trying to patch in the picked item I get "Network error when using patch: jvt_name is required". Two things to note: a) it's not required, and b) I am providing a value for it. Below I've included the spec of the column and the full formula that's throwing the error:

nickellis74_0-1709726809492.png

If(
 //Already scanned?
 Not(
 CountRows(
 Filter(
 'Picked Items',
 Order.Order = _orderGUID,
 'Order Line'.'Order Line' = liveOrderLine.'Order Line',
 Serial = Self.Text
 )
 ) = 0
 ),
 //Notify user
 Notify(
 "You have already scanned this serial number",
 NotificationType.Warning
 ),
 If(
 //Order line exists?
 CountRows(
 Filter(
 'Order Lines',
 Order.Order = _orderGUID,
 'Part Number' = txtPartNumber.Text
 )
 ) = 0,
 //Create order line
 Notify("Creating an order line");
 UpdateContext(
 {
 newLineNumber: CountRows(
 Filter(
 'Order Lines',
 Order.Order = _orderGUID
 )
 ) + 1,
 polyOrder: LookUp(
 Orders,
 Order = _orderGUID
 )
 }
 );
//////THIS IS THE BIT THAT'S FAILING//////
 Set(
 liveOrderLine,
 Patch(
 'Order Lines',
 Defaults('Order Lines'),
 {
 Order: polyOrder,
 'Part Number': txtPartNumber.Text,
 'Line Number': newLineNumber,
 Quantity: 0,
 Name: txtOrderNumber.Text & newLineNumber
 }
 )
 ),
 //Retrieve order line
 Notify("Recycling an order line");
 Set(
 liveOrderLine,
 LookUp(
 'Order Lines',
 And(
 Order.Order = _orderGUID,
 'Part Number' = txtPartNumber.Text
 )
 )
 )
 ),
 //Add the picked item
 UpdateContext({newQty: liveOrderLine.Quantity + 1});
 Patch(
 'Picked Items',
 Defaults('Picked Items'),
 {
 Order: liveOrderLine.Order,
 'Order Line': liveOrderLine,
 'Part Number': txtPartNumber.Text,
 Serial: Self.Text
 }
 );
 
);
//Reset the serial number box
Reset(Self);

Lastly - the smart highlighting is ignoring the part where I actually supply the value:

nickellis74_1-1709726921241.png

Honestly, I don't know what's going on. Any and all help will be very much appreciated!

Nick

Categories:
  • nickellis74 Profile Picture
    430 Moderator on 07 Mar 2024 at 08:55:27
    Re: Network error when using patch

    Thanks @dpoggemann - that did it! Thank you so much!

  • Verified answer
    Drew Poggemann Profile Picture
    9,278 Most Valuable Professional on 06 Mar 2024 at 15:57:11
    Re: Network error when using patch

    Hi @nickellis74 ,

    Can you try something like this?

    Set(
     liveOrderLine,
     Patch(
     'Order Lines',
     Defaults('Order Lines'),
     {
     Order: LookUp('Orders', ID = PolyOrder.Order),
     'Part Number': txtPartNumber.Text,
     'Line Number': newLineNumber,
     Quantity: 0,
     Name: txtOrderNumber.Text & newLineNumber
     }
     )
     )

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473

Featured topics

Loading complete