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 / Collection not passing...
Power Apps
Unanswered

Collection not passing details to SharePoint List

(0) ShareShare
ReportReport
Posted on by 22

Hi there. I am new to PowerApps and still very much trying to find my way around. 

 

I have created a shopping cart app for use when ordering PPE items. The app uses 3 SharePoint lists. One that contains the information to populate the gallery, one that contains the parent record for the order with the users name, total items ordered and comments, and the final one stores the child records of the items ordered. When the order is placed I have set it to send an email to the purchasing team with the detail orders. 

 

The problem I'm having is with passing data to the SharePoint list, well only one of them. My app is passing the data to the parent list, it populates all of the correct fields however, the actual items ordered are not being entered into the other SharePoint list.  I have attached copies of my code if anyone could point out my error or point me in the right direction that would be great. I feel I'm almost there with this. 

 

I have put an order into the system and attached screenshots of the two lists one with the details in and then the empty list that I think should have the ordered items as well as the code I am using for this. 

Screenshot 2022-06-10 130452.png
Screenshot 2022-06-10 123550.jpg
Screenshot 2022-06-10 123613.png
Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    You have only patched PPE orders not PPE Order Items as well.

     

    If using SharePoint List I would use Forms within Power Apps and use the SubmitForm() function. Removes the need for Patch.

     

    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.

  • cdowkes Profile Picture
    22 on at

    Hi thank you for your reply. 

    My understanding was that the "Collect" function would allow me to add the contents of the collection to the SharePoint list. I can do this with another sample app but it wont work here for some reason. 

     

    Collect('PPE Ordered Items', AddColumns(colShoppingCart, "OrderID", varRecordID));

     

  • MVP-Phipps Profile Picture
    3,521 Super User 2024 Season 1 on at

    Yes you can use the 'Collect' function to add records to your SharePoint List. Can you do some debugging for me, can you change this to add to a local collection and show me the output of the local collection. The reason I ask, I want to see if you AddColumns function is populating the varRecordID.

     

    Alternatively, try Patch rather than Collect. 

  • cdowkes Profile Picture
    22 on at

     

    I have sent the information to a new collection and it seems to have populated in there. I've also included here the code I'm using for this now. 

     

    set(varRecordID, Patch('PPE Orders', Defaults('PPE Orders'),
    {Title: TextInput4.Text, OrderComments: TextInput1.Text, OrderTotal: Sum(colShoppingCart, QTY)}).ID);
    
    Collect(colitemtest, AddColumns(colShoppingCart, "OrderID", varRecordID));
    
    Office365Outlook.SendEmailV2("craig.xx@xx.com", User().FullName & Text("'s PPE Order"),"Hi." & "<br>" & "Please see below my PPE order" & "<br>" & "<br>" & Concat(colShoppingCart, "Item: " & Title & "<br>" & "Size: " & ItemSize & "<br>" & "Qty: " & QTY & "<br>" & "Product Code: " & ProductID & "<br>" & "<br>") &"Comments: " & "<br>" & TextInput1 & "<br>" & "<br>" & Label5 & "<br>" & "<br>" & "Thank you" & "<br>" & "<br>" & User().FullName,{Cc: User().Email, Importance:"High"});
    
    Reset(TextInput1); Clear(colShoppingCart);
    Set(varShowpopup1, true);

    cdowkes_0-1655280949449.png

    For reference my sharepoint list that remains empty

    cdowkes_1-1655281047421.png

     

    Thank you

     

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard