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

Adding Relational records when creating the one to many record SQL

Hi All,

 

I've been given a SQL database to work with that stores fault information. There is a one-to-many relationship to a table of images that relate to the fault. 

 

When an engineer attends a fault a record is to be created in the fault table in the database and the engineer may upload photo's of the fault to the database, there may be more than one image so there is a one to many relationship between the fault table and the photo's table.

 

In powerapps, I'm struggling with how to get records written, do I need to create the fault report first, then try and reference the primary key of the fault report to pass as the foreign key for the photo's,

 

OR

 

Can I write the whole lot in one go and pass the photo's in as a collection in the form, or patch statment?

 

How would you go about doing it?

 

Many thanks in advance to all that repond.

3 REPLIES 3
Lisabel0
Level 8

Re: Adding Relational records when creating the one to many record SQL

Please explain more about what you want to achieve adding the controls in PowerApps. For example, I want to create one record with edit form, and then reuse the image control in this form to create a new record of another data source.

Re: Adding Relational records when creating the one to many record SQL

Thats correct. For example, I want to create a record that is for a whole event say the delays to a que at a checkout, so I would log that in a data source called QueRecords. Then When the QueRecord is create on the same page, I would like to create a record of the delay to the que so I can have multiple que delay events in a data source called Que delays linked to the Que record. I want to create them at the same time but how do I identify the que record for the que delay before creating it. Or do I have to create the que record and then use some filter or lookup to try and find the correct record.
seadude
Level 10

Re: Adding Relational records when creating the one to many record SQL

Really need a reply on this topic! I'm facing the same issue:

 

How do you Patch multiple SQL records that have PK/FK relationships?

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 18 members 4,242 guests
Please welcome our newest community members: