cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Determine which Sharepoint List to Patch

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. 

3 REPLIES 3
Highlighted
Super User II
Super User II

Re: Determine which Sharepoint List to Patch

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

Highlighted
Helper I
Helper I

Re: Determine which Sharepoint List to Patch

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. 

Highlighted
Super User II
Super User II

Re: Determine which Sharepoint List to Patch

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

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (7,587)