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 / Merging a collection w...
Power Apps
Unanswered

Merging a collection with SP list

(0) ShareShare
ReportReport
Posted on by 289

Hi Guys,

I have a challenge that is a bit beyond my capabilities, firstly, let me explain what I have built so far:

 

I have an app that allows users to submit approval requests. Each request can have one or many items associated with it. In order to utilise a repeating table I have a gallery in my form with a collection as source. Once the user submits the form, the OnSuccess property of the form calls a patch function to write the collection contents to a SP list.

 

The challenge I have is the user may recall requests to the app to edit them, this also includes editing the items associated with each request, they may edit existing items, delete items and add new items. 

 

What I need to be able to do is sync the data between my collection and SP list. I need to be able to do 3 things:

 

1. Add new items to my SP list (where exists in collection but not my list)

2. Remove items from my SP list (where exists in list but not collection)

3. Update items in my SP list (where exists in both collection and SP list)

 

I really don't know where to start with this.

Any help would be greatly appreciated 😊

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @JimJim 

    Of you are using a single list that contains a one to many relationship between requests and items, then your design is flawed and you will have problems. You will need at least 2 tables to accomplish your goal.

  • JimJim Profile Picture
    289 on at

    @Drrickryp 

    I have 2 table, one master and one for the items. The ID from Master is being written into the items table to allow me to join them up

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @JimJim 

    I don't have any idea what your app looks like but it seems to follow something like this one.  !1.jpg

    The parent table is on the left, The details of that order are in the upper right and the Child table (The product items of the order are in the lower right.  In this design, a new order can be entered and then the products ordered are submitted using a patch for the product.  No collections are necessary to execute the necessary functions for the two tables.  I'm not saying your design is incorrect but my preference is to avoid using collections unless there isn't another way to manage the data.  

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @JimJim 

    I don't have any idea what your app looks like but it seems to follow something like this one.  !1.jpg

    The parent table is on the left, The details of that order are in the upper right and the Child table (The product items of the order are in the lower right.  In this design, a new order can be entered and then the products ordered are submitted using a patch for the product.  No collections are necessary to execute the necessary functions for the two tables.  I'm not saying your design is incorrect but my preference is to avoid using collections unless there isn't another way to manage the data.  

  • JimJim Profile Picture
    289 on at

    @Drrickryp , Thanks for replying. I decided to use a collection so that all updates could be made at the same time. I think I'm too far down that path to change it now

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 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard