How to add multiple photos to a single column...

(ControlProcess Pav) #1

How to add multiple photos to a single column?

I will have several Inspection Questions.

For each inspection question, I want to allow the user freedom to take multiple photos.

Yes, I can make a Child Table named photos.

But then, the child table photos is linked to the record (foreign key) not to each question (which is a column in that record).

That is, in a single inspection… for question 1, key aaaaaa, user takes 5 photos.

They appear on the inline table below question 1.

At table photos, 5 records were created, one for each photo.

key 1111, foreign key aaaaaa key 1112, fk aaaaaa key 1113, fk aaaaaa key 1114, fk aaaaaa key 1115, fk aaaaaa

Then for question

2 of the inspection one, still key aaaaaa (each inspection is a single record), I take two more photos.

At table “photos”, two more records are created. key 1116, fk aaaaaa key 1117, fk aaaaaa

And now the table for both question 1 and question 2 will show all the 7 photos, instead of Question 1 showing from 1 to 5 and Question 2 showing from 6 to 7.

Any way to link records of a child table to a specific column of a specific record?

(Aleksi Alkio) #2

At least you can add one related table for one column.

(ControlProcess Pav) #3

@Aleksi_Alkio Sorry Aleksi. I don´t understand what you mean.

If you mean having one photo table per column (inspections item), what if you have 40 inspection items?

Should I create 40 photo tables? Won´t that be a burden on the system, which will be creating a view for each table, etc?

I was wondering if there isn’t a trick, where somehow the child table’s FK will be a concatenation of parent table Key+Column name, and then on the parent table, a specific column (checklist item) will show photos only of child table records which have that key?

Or something along those lines… :frowning: