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 / Reducing Quantity from...
Power Apps
Unanswered

Reducing Quantity from another Sharepoint List after Patching collection

(0) ShareShare
ReportReport
Posted on by

Hello great community!

 

I'll try to explain as good as possible regarding my issue.

 

I have a Sharepoint list which is empty with columns ( ID , ID06, QR, Quantity, Site & Timestamp ) 

I manage two warehouses with over 2000 items each where I'm trying to implement a Scanning App which allows our 300 employees to take out material through scanning The items physical QR Code with a mobile device.

The procedure in the app is to scan their ID06 card, then scan the Items physical QR code, choose which warehouse the item is taken from (2 choices), write the quantity taken and then add it to the collection and then submit the collection using a Patch function. 
At this point everything works but the last function i need to complete is that i also have another SP list with all my warehouse items (inventory list) so what i would like to do is whenever the patch is being completed the item need to reduce the quantity from the inventory SP list.

 

In my Inventory List the columns are item name and quantity nothing more at the moment
How can this be done? should i store the items physical QR-code in a column in the Inventory SP list that links up with the patched QR code, if so, is it the patch function that need to be changed or do i need to go a different route?

 

Thanks!

Best Regards
Vincent

PatchButton.PNG
ScanItemsApp.PNG
PatchedItemsSPlist.PNG
Categories:
  • VincentGiovanni Profile Picture
    on at

    Hello Again,

    Need to add some more info and questions sorry!
    The QR codes that i generate is through a website which I manually implent the data in the QR-Code, and then I download the QR-code as a GIF file.

    I also wonder since i need to update the stock value whenever our warehouses recieve deliverys, How can I update the Inventory SP list with the quantity, I do not store article numbers on every item since we can order same material but from different suppliers which would have made it difficult to maintain. But the QR Code is allways to the same item independent of the supplier of the product so it would be great if you could find the specific item through QR code and change the stock value thereafter.

    Is this even possible at all or should i reconsider the whole structure of my app, I've a short deadline.

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

    Hi @VincentGiovanni ,

    Two things - you can make your original patch more efficient (much quicker) as below

    Patch(
     'Uttag av material';
     ForAll(
     getMultipleBarCodes;
     {
     ID06: UAHIDQ6TxtInput.Text ; 
     QR: UAMSkannaNateriaLTxtInput.Text; 
     Antal: UAMQtyTxtInput.Text; 
     Site: UANSiteComboBox.Selected; 
     Tidspunkt: Now()
     }
     )
    );; 
    Notify(
     "Uttag av material blev lyckat! Bra lobbat"; 
     Success
    );;

    If you had a separate list with QR and Quantity fields

    With(
     {
     wItem:
     LookUp(
     YourQRList,
     QR = Self.Value
     )
     },
     If(
     !IsBlank(wItem.QR),
    	 Patch(
     YourQRList,
     {
     ID: wItem.ID,
     Quantity: wItem.Quantity + 1
     }
     ),
     Patch(
     YourQRList,
     Defaults(YourQRList),
     {
     QR: Self.Value,
     Quantity: 1
     }
     )
     )
    )

    Also, can you please remember to post any code as Text

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • VincentGiovanni Profile Picture
    on at

    Hello @WarrenBelz 

     

    Thank you for your time and effort, it's highly appreciated.
    I tried your With() section code and seem to come across some obstacles, Since my "QR SP list" is a image type column it returns an error saying the record argument is expected and I've used the Self.Value.


    Also, is "wItem" uses as a collection name from the collect button or what does it represent in my case?

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

    Hi @VincentGiovanni ,

    Two things - throw away the Image column - it does not "play well" with Power Apps and you simply cannot write to it. The With() statement reference can be anything you want to call it (DonaldDuck will work). It is essentially no more than a (very) temporary Variable used further down in the code - I have a blog that may interest you.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

     

  • VincentGiovanni Profile Picture
    on at

    Thank you!
    I do understand your point and I agree, altough what is the preffered column in which I'll store the QR-codes that are downloaded as a Jpeg file instead of the image column.

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

    Hi @VincentGiovanni ,

    A number of options, but if you only have one QR code per record, you can either store it as an attachment or in a multi-line text field as Base64 text (I would recommend the latter). I have a blog on the various options

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • VincentGiovanni Profile Picture
    on at

    Hello again @WarrenBelz 

     

    Unfortunately I've not worked with Base64 earlier, so bear with me.

    My understanding is as follows;

    I remove the QR code column with the QR codes and store it in a different column (MultiLine Text column) and convert every Image to Base64 Text (I'm guessing this is a very long text, maximum chars for column is 255?), After that is accomplished, I Shall use the previous Syntax you provided for me in the OnSelect Property of my Save Btn which would reduce the quantity from my Inventory list if the Base64Text is a match?

    Did i get it right?

    Questions
    1. I do not know how to store QR codes as Base64 Text which is my first obstacle, is this easy since I already have around 200 items atm with QR-codes that need to be converted?.

    2. After storing everything as Base64 Text, will i still be able to print out the Base64 Text as QR-codes to put it physically on the item if by any chance it got lost or broken?

    SPList.PNG
    Buttons.PNG
  • WarrenBelz Profile Picture
    156,963 Most Valuable Professional on at

    Hi @VincentGiovanni ,

    Yes - you use a multi-line text column (the code is certainly bigger than 255 characters). The process for doing this is in this blog article of mine I linked earlier, however if you want to print them out, you could store them in a SharePoint Library (process is here) unless you do a full-screen Image control on a printable screen and use the Base64 item.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • VincentGiovanni Profile Picture
    on at

    Hello @WarrenBelz 

     

    I've read your blog several times trying to understand the information you're providing, having trouble comprehending the post.

     

    I've added the Multi-Line Column now, and converted a couple of QRcodes to Base64Text and then copied it to each corresponding row. 

    To the application,  Regarding the with() syntax you provided earlier, I'm still trying to figure it out so i attached a Word-file and wrote some questions after the "//" in the syntax.
    Where does the Base64 Text come in the picture for the app in my case ?

    Once Again, I'm deeply grateful for the patience and time you're putting to assist me, and sorry for being a little slow.

     

     

     

     

     

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

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard