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 / Determine which Sharep...
Power Apps
Unanswered

Determine which Sharepoint List to Patch

(0) ShareShare
ReportReport
Posted on by 193

Hello, 

I have an app using multiple sharepoint lists that hold information for different types of items and their costs. Some of these items can be components of other items. I have a link table for these Parent-Component relationships that holds the primary ID for each and the "CategoryID" for each, which tells me which table that item belongs to. However, when updating prices of components, I have the price updating in the link table, but now I need to update the price of the parent item. 

The problem I am facing is how to use a calculation to determine which table the parent item is located. Right now, I have 5 item tables and don't anticipate adding more so I could use If statements to match the category ID to the right table (If CategoryID = 1, Patch Table1), but I am hoping there is an easier way. 

It might also be worth mentioning that after updating a price, I use GroupBy to create a collection holding all the link information for each unique parent/category and added a column to Sum up all the grouped prices. I just need to be able to easily patch that price into the correct table without too much effort. 

Categories:
  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    You can use a Switch function:

    Switch(CategoryID, 1, Patch Table1, 2, Patch Table2)

     

    Let me know if this helps. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

  • CAH2035 Profile Picture
    193 on at

    I can see how that can be useful instead of using an If function for everything, but I don't think it solves my issue. If, in the future, I need to add a new category, I need to add to that function. 

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at

    If you add a new category and/or a new table, you will have to specify that in your app in one way or another. 

     

    ---
    If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

     

    Thanks!

    Hardit Bhatia

    Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 258

#3
Mohsin Ali Profile Picture

Mohsin Ali 231

Last 30 days Overall leaderboard