cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
virakones
Resolver II
Resolver II

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 II
Super User II

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 II
Super User II

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

Thank you!

This is a great resource.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Kudoed Authors
Users online (47,040)