cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
virakones
Responsive Resident
Responsive Resident

How to use Patch function to add record to Parent entity in 2 related entities?

Hi,

 

I have 2 entities, Orders > 1:N > Product Groups

- Effectively, an order can contain many groups of products

 

I have 2 separate gallery controls, GallleryOrders and GalleryProductGroups, that displays the records from the respective entities. 

- GalleryProductGroups shows a filtered list of items related to the specific Order selected: GalleryOrders.Selected.'Product Groups'

 

Now, I have a text input control that submits text values to a temporary Collection called ProductGroupInfo, with a column ProductInfoItem

From there, I would like the add the text values collected from ProductInfoItem to the Product Groups entity as a new record, but also have that record relate to the Order that was selected from the GalleryOrders

 

Question: What would be the correct way to use the Patch function (maybe ForAll as well?) to be able to make a record to the Product Groups entity from the info ProductGroupInfo collection, that relates to the Order selected from the gallery? I'm not a developer so I am a bit stuck here.

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

Hi @virakones 

It sounds like what you want to do is very similar as the Northwind Traders database sample. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/northwind-install  If you haven't seen it, I suggest you check it out.  Going through the exercise of creating it gave me a good idea of how to handle the relationships in CDS.

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

Hi @virakones 

It sounds like what you want to do is very similar as the Northwind Traders database sample. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/northwind-install  If you haven't seen it, I suggest you check it out.  Going through the exercise of creating it gave me a good idea of how to handle the relationships in CDS.

Thank you!

This is a great resource.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Users online (4,686)