Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • JimJim Profile Picture
    289 on at
    Re: Merging a collection with SP list

    @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

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Re: Merging a collection with SP list

    @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
    Re: Merging a collection with SP list

    @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
    Re: Merging a collection with SP list

    @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
    Re: Merging a collection with SP list

    @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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,635 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard