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 after 15 collects
Power Apps
Answered

Patch after 15 collects

(0) ShareShare
ReportReport
Posted on by 42

Hello,

 

I have an order fulfillment app that uses a barcode scanner to scan product, then the order handler places the order in the box and submits. On submit, the record updates in SQL server and upticks the qty filled by 1. We seem to be having issues where too many calls are being made and these records are not being updated properly and data lost/overfulfilled due to the 10-15 seconds between each call. Is there a way to save to a collection and then bulk patch with forall after 15-20 orders are filled?

 

Thanks!

Categories:
  • sayyed007amir Profile Picture
    357 on at

    Yes you can use this condition:

     

     

    If(CountRows(Collection)>15,ForAll(your patch code) )

     

     

     
     
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @Pseifert :

    Could you tell me if you want to implement the following functions:

    • Generate the scan result as a record and store it in a collection.
    • This collection stores up to 15 records.
    • When there are 15 records in the collection, the system prompts the user to submit.
    • After the user clicks the submit button, these 15 records will be added to the data source at once, and then the collection will be emptied.
    • Loop the above operations.

    I assume my assumption holds.

    I've made a test for your reference:

    My Date source:'[dbo].[Table_2]'

    Field NameDate Type
    barcodevarchar(50)
    upticks   int
    idint/Primary key

    1\Add a BarcodeScanner control(BarcodeScanner1)

    OnScan:

     

    If(
     CountRows(mycollection) > 15,
     Notify("Cache is full, please submit data"), /*When the collection storage record reaches 15, it prompts the user to submit data in time*/
     Collect(
     mycollection,
     {
     barcode: BarcodeScanner1.Value,
     upticks: 1,
     id: CountRows('[dbo].[Table_2]') + CountRows(mycollection) + 1 /*id is the Primary Key of my data source*/
     }
     )
    )

     

    2\Add a button

    OnSelect:

     

    Collect('[dbo].[Table_2]',mycollection);Clear(mycollection)

     

    Use collect to submit multiple records at once to avoid calling the API multiple times. Clear the collection after submission.

    Best Regards,

    Bof

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 342 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 239

Last 30 days Overall leaderboard