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

(0) ShareShare
ReportReport
Posted on by 209

Hello! Im creating a shopping cart app and sending the users selected items as an HTML table. I have followed Shane Young's video Power Apps Shopping Cart new for 2021 - YouTube and I am seeming to have issues submitting due to a 'Network Error when using patch function'. In the video at "35:23" he creates a variable to create an Order ID to the patch so you can store order #'s as the app was used. I'm also trying to create an order ID and use it in the HTML table and I get an error when trying to submit after I add the VarRecord into the HTML text. When I removed the varRecord I was able to submit and send an email. Is there a workaround this error?

 

This is what I have in the HTMLText

"<h3>Invenory Order</h3>" &

"<table width='100%'> " &
 "<tr>
 <td> Order ID: </td> <td>" & varRecordID2 & "</td>" &
 "</tr>" &
 "<tr>
 <td> User: </td> <td>" & TitleTxt.Text & "</td>" &
 "</tr>" &
 "<tr>
 <td> Date: </td> <td>" & Today() & "</td>
 </tr>" &
 "<tr>
 <td> Date Needed: </td> <td>" & DatePicker1 & "</td>
 </tr>" &
"</table> <br>" &

"<strong> Items: </strong>" &
"<table width='100%' border='1' cellpadding='5' style='border:1px solid black; border-collapse:collapse'>" &
 "<tr style='background-color:#efefef'>
 <th>Id</th> <th> Name </th> <th> Description </th><th> Accessories </th>
 </tr>
 <tr>" &
 Concat(Gallery3.AllItems,
 "<td>" & ID & " </td>
 <td>" & Description & " </td>
 <td>" & Qty & " </td>","</tr><tr>") &
"</table>"
 

 

And This in my  submit button onselect

Set(varRecordID2, Patch(Table3, Defaults(Table3), {Title: User().FullName, 'Item ID': ItemIDTxt, Description: ItemDesTxt, 'Order Qty': OrderQTYTxt, 'Date Needed': DatePicker1, Comments:CommentsBox.Text}).'Order ID');

Office365Outlook.SendEmailV2("IT@apadex.com","Inventory",HtmlText1.HtmlText,{Importance:"High"})

 

thanks to anyone who can help!

 

Categories:
I have the same question (0)
  • SebS Profile Picture
    4,822 Super User 2026 Season 1 on at

    @Broly123 

     

    Each of the controls You use to collect data has a property inputText have  .Text Date picker will have .SelectedDate

     

    Your Patch function only uses property on one of the controls, which is CommentsBox.Text

    You need to add .SelectedDate to your DatePicker1 and .text to other Controls which will assign data from Control to patch, and than patch will Patch it Table

     

    Set(varRecordID2, Patch(Table3, Defaults(Table3), {Title: User().FullName, 'Item ID': ItemIDTxt.Text, Description: ItemDesTxt.Text, 'Order Qty': OrderQTYTxt.Text, 'Date Needed': DatePicker1.SelectedDate, Comments:CommentsBox.Text}).'Order ID');

     

  • Broly123 Profile Picture
    209 on at

    @SebS Thanks for the response! For some reason The submission works whether the properties have input text or not. The problem is the "collection data". If I don't put anything in the collection, I can submit to the email with the tables blank , having the input text or not. In order to have the tables in the email display the collection from the user, I have to delete the varRecord in the HTML text. I inserted the VarRecord back into the html text and now see "Network error when using patch function: The item has already been created on the server". So I'm thinking it's the VarRecord itself?

  • Verified answer
    SebS Profile Picture
    4,822 Super User 2026 Season 1 on at

    @Broly123 

     

    You can try to capture the whole record.

     

    Set(varRecordID2, Patch(Table3, Defaults(Table3), {Title: User().FullName, 'Item ID': ItemIDTxt.Text, Description: ItemDesTxt.Text, 'Order Qty': OrderQTYTxt.Text, 'Date Needed': DatePicker1.SelectedDate, Comments:CommentsBox.Text}));

     

    And then, whenever You use it, refer to it.

     

    varRecordID2.'Order ID'

     

    "Network error when using patch function: The item has already been created on the server".

    On many occasions, this error has more to do with corrupted Excel table _PowerAppsID_ rather than anything else but have a look.

     

    Excel as DataSource is really bad and will cost you time on debugging it's better to use SP List

  • Broly123 Profile Picture
    209 on at

    @SebS Thanks!! That worked. But I didn't get a number for the 'Order ID' in the email. Is it because the data source being excel? Also, I tried to move make a list in sharepoint from the existing excel source. I have over 800 rows in excel but I'm only getting back 10 rows when trying to transfer the data. 

     

    #2. I used tabular data for the HTML code and On the Concat I inserted my own values. However, The table is still showing the previous information from the original table, probably because I didn't do something right.

     

    Broly123_0-1689349503698.png

    This is what I have in my formula.

    Concat(Gallery3.AllItems,
     "<td>" & ID & " </td>
     <td>" & Description & " </td>
     <td>" & Qty & " </td>","</tr><tr>") &
    "</table>"

    Do the values have to be exactly what's named in my collection?

    Broly123_1-1689349623712.png

     

    Or do they have to be what's named in the gallery? (ex. Text=ThisItem.ID)

     

     

  • Verified answer
    SebS Profile Picture
    4,822 Super User 2026 Season 1 on at

    @Broly123 

     

    The issue here is Column ID in Excel is actually called _PowerAppsID_, and it's not visible to the user.

    Now You trying to recreate an example of what was showcased in the SP List in Excel, and there will be a few anomalies that will create a challenge one of them is the Column ID in short-term power Apps working out Excel ID in a totally different way than SP List do.

     

    Please Create an SP List and connect Your app to it and follow the Video to make it work it should be less challenging.

     

    Now to move data from Excel to the SP list is not a difficult task if You will use Power Automate 800 records will transfer in around 2-4 min

     

    1. Create an instant flow

    2. List rows present in a table

    3. Apply to each

    4. inside of Apply to each place action Create Item

     

    the flow will look like this

     

    SebS_0-1689351043246.png

     

    now there are two things You need to change pagination in the List rows present in a table its set default to 200 or something like that

     

    SebS_1-1689351108953.png

     

     

    and to speed up things you need to set Apply to each setting

     

    SebS_2-1689351183566.png

     

    Rest it's easy in create Item you par SP List column to Column provided by List rows present in a table

     

    Hope that Helps

     

  • Broly123 Profile Picture
    209 on at

    @SebS Sending the list worked like a charm! Atleast for the first sheet, the other sheets im getting error running the flows.

    FLOW3.PNG 

    Not sure why I'm getting this error because I have the Qty column set to numbers

    FLOW4.PNG

  • SebS Profile Picture
    4,822 Super User 2026 Season 1 on at

    @Broly123 

     

    One of the Qty is Blank / Empty Power Automate have problems to handle empty Excel cells You will need to place an expression to handle empty cells or check your table and when the cell is empty place 0 do not leave it empty

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 408

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 319

Last 30 days Overall leaderboard