Copying row and getting the reference rows (Appointments and Images)

Hi,

I have a scheduling app where I have appointments that have a referenced table for images. I want to be able to make a copy of an appointment and also have the referenced table of images copied over to the new appointment.

Programmatically I need the ApptId of the original appointment, the ApptId of the new appointment and then update the referenced image table to add rows with the new ApptId and all the image url's that match the original ApptId. If that makes sense haha.

Appointment table
ApptId: 1

Image table:
ApptId: 1
ImageURL: appt1-imagehere

Then needs to be this when I click copy:

Appointment table
ApptId: 1
ApptId: 2

Image table:
ApptId: 1
ImageURL: appt1-imagehere
ApptId: 2
ImageURL: appt1-imagehere

0 2 133
2 REPLIES 2

Hello @jmable, so the good ol' copy a row and its child tables type of thingy?

You can read more about that in this post from Koichi sensei

https://www.googlecloudcommunity.com/gc/Tips-Tricks/Copy-parent-record-together-with-child-records-A...

Steve
Platinum 4
Platinum 4

It is not possible to copy images using the app--you'd have to use something external to the app to do that.

Top Labels in this Space