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 a Collection to ...
Power Apps
Answered

Patch a Collection to SharePoint List - All Entries Identical

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I'm trying to Patch a Collection to a SharePoint list, but all it does is write the same exact entry for whatever number of entries are in the Collection rather than looping through each individual one and recording it back correctly. Here is what the screen looks like before I press the log entries button (note the 2 entries in the lower right quadrant.

Quad Screen-2 Entries.png

When I examine the Items property of the Collection, both entries are showing up.

Collection Found.png

It gets written back to SharePoint like this. As you can see it only appears to be picking up the first barcode value that was scanned.

Duplicate Entries.png

Here is the OnSelect formula for the "Log Your Entries" button. I tried it without the "As item" reference as well with the same result.

ForAll(
 colTracking As item,
 Patch(
 'Admin Scan Log',
 Defaults('Admin Scan Log'),
 {
 'Barcode Value': lblBarcode.Text,
 'Operator Email':lblEmail.Text
 }
 )
);
Clear(colTracking); Reset(txtScanBenchBarcode)

 

Here is the current OnChange property of the Step 2 text input field. The group I am making the app for wants Operators to have immediate feedback as to whether or not the tools match the bench they are working at and whether or not the calibration is past due so in a perfect world, I'd like to be able to grab the information from the "Expected Tools" gallery on the left and patch the values (using the barcode as the key) to my "Admin Scan Log". Is that possible? If so, how do I go about it?

Collect(colTracking,{'Barcode Value':Self.Text,'Operator Email':varUser.Email});Reset(Self);SetFocus(Self);

 

 The items property of the Your Tools gallery is:

colTracking

 

Thanks in advance for your help!

Teresa

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

    Hi @tagustin2020 

     

    You need to patch items from your collection but you patching the content of the controls instead

     

    ForAll(
     colTracking As item,
     Patch(
     'Admin Scan Log',
     Defaults('Admin Scan Log'),
     {
     'Barcode Value': item.'Barcode Value',
     'Operator Email':item.'Operator Email'
     }
     )
    );
    Clear(colTracking); Reset(txtScanBenchBarcode)

     

  • tagustin2020 Profile Picture
    on at

    @SebS 

     

    Thanks Seb! That worked like a charm. Did you happen to see my "Part B" question from the original post?

     

    "The group I am making the app for wants Operators to have immediate feedback as to whether or not the tools match the bench they are working at and whether or not the calibration is past due so in a perfect world, I'd like to be able to grab the information from the "Expected Tools" gallery on the left and patch the values (using the barcode as the key) to my "Admin Scan Log". Is that possible? If so, how do I go about it?"

     

    If you have any advice for me, I would greatly appreciate it!

    Teresa

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

    @tagustin2020 

     

    Yes, it's possible. You can use LookUp and Veryfy if a Scanned Barcode exists in the galley or the source of the gallery.

     

    Or you can check if the gallery contains the barcode by using "in" operation. It all depends on how you want to display this message to the Operator.

     

    In Gallery, with your tools, You can add an icon that will indicate if the tool belongs to that bench or not and create a LookUp and if result of the lookup is not Blank means the Tool is in the collection and means it belong to the bench so You can display a icon indicating this

  • tagustin2020 Profile Picture
    on at

    @SebS 

     

    Hi Seb,

     

    Great to hear that it is possible. The name of the SharePoint list shown in the gallery to the left is 'Admin Desk Tools'. To recap, the name of the list I am trying to write daily log entries to is 'Admin Scan Log'.

     

    Below is an OnSelect formula that Warren Belz helped me with for a separate app where I was only scanning 1 barcode at a time (and providing immediate feedback) versus processing multiple barcodes all at once.

    With(
     {
     _Record:
     LookUp(
     'Tools and Benches',
     'Barcode Value'= txtScanBenchBarcode.Text
     )
    },
    Patch(
     'Tool Bench Scan Log',
     Defaults('Tool Bench Scan Log'),
     {
     'Barcode Value': txtScanBenchBarcode.Text,
     'Operator Email': varUser.Email,
     'Equipment Match': tglIsMatch.Value,
     'Parent ID': _Record.ID
     }
     )
    );
    Navigate('Confirmation Screen');

    Here is the OnSelect formula you just helped me with.

    ForAll(
     colTracking As item,
     Patch(
     'Admin Scan Log',
     Defaults('Admin Scan Log'),
     {
     'Barcode Value': item.'Barcode Value',
     'Operator Email':item.'Operator Email'
     }
     )
    );
    Clear(colTracking); Reset(txtScanBenchBarcode)

     

    I added some visual indicators. The one on the left is working, the one on the right is not.

    The Visible property for the green check icon and label is below. 

     

    ThisItem.'Barcode Value' in galBenches.AllItems.'Barcode Value'

     

    CalibrationPastDue.png

    I would also like to be able to provide a visual indicator if the tool is past the due date for calibration. I added a Yes/No toggle to the gallery on the left (Data Source: 'Admin Desk Tools'). Could you help me 1) figure out how to work it into the Patch formula so I can write it to the 'Admin Scan Log' data source and 2) Help me with the Visible property of the red X and associated label? If I can get those 2 things working, I can do the rest in Power Automate (an email is sent to the shift supervisor if something is off so they can help get it fixed). I am supposed to demo this prototype app tomorrow at 1pm to our Manufacturing Supervisor so if you could help me figure it out before then, I would be super grateful! No worries if you can't, I can always just tell her I'm working on it.

     

    Thanks Seb!

    Teresa

     

     

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

    @tagustin2020 

     

    One step at a time. Below is the formula: Adjust the column name in the LookUp. I assume it is called a Barcode also I assumed that 'Equipment Match' is Yes /  No

     

     

     

    ForAll(
     colTracking As item,
     Patch(
     'Admin Scan Log',
     Defaults('Admin Scan Log'),
     {
     'Barcode Value': item.'Barcode Value',
     'Operator Email':item.'Operator Email'
     'Equipment Match':If(IsBlank(Lookup('Admin Desk Tools',Barcode = item.'Barcode Value'),false,true) 
     }
     )
    );
    Clear(colTracking); Reset(txtScanBenchBarcode)

     

     

     

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

    @tagustin2020 

     

    In the Right Visual use Not operator insted In:

     

    ThisItem.'Barcode Value' Not galBenches.AllItems.'Barcode Value'
  • tagustin2020 Profile Picture
    on at

    @SebS 

     

    Hello Seb. Thank you for the prompt reply! The piece of data I am trying to Patch is actually called 'Calibration Past Due'. It is a Yes/No type column. The column names are the same in both lists: 'Calibration Past Due' and 'Barcode Value'. I'm getting red squigglies under the LookUp portion of the formula. How can I get it to recognize and write the stored value back to my 'Admin Scan Log' list? Am I simply missing a piece of punctuation or is there something else going on?

     

    squiggle.png

    Kind regards,

    Teresa

  • tagustin2020 Profile Picture
    on at

    @SebS 

     

    Hi Seb,

     

    I thank you for providing that formula as I can use it to show a red X icon if a scanned barcode is not matching anything in the left-hand gallery. The right visual indicator is actually a reference to the 'Calibration Past Due' column though. Can you advise me on how to show green or red indicators based on the true/false value of that column?

     

    Thanks!

    Teresa

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

    @tagustin2020 

     

    you missing ")"

     

    If(IsBlank(Lookup('Admin Desk Tools','Barcode Value' = item.'Barcode Value'),false,true) 
  • SebS Profile Picture
    4,746 Super User 2026 Season 1 on at

    @tagustin2020 

     

    use lookup if 'Calibration Past Due'  is True make Green Icon visible and when 'Calibration Past Due'  is False make Red Visible

     

    Replace DataSource with name of DataSource where 'Calibration Past Due'  column is located

     

     

    LookUp(DataSource,'BarCode Value' = Thisitem.'Barcode Value','Calibration Past Due')

     

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard