Jump to content
Server Maintenance This Week. ×

Images with duplicate Id's


jarmen

This topic is 4806 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I have a database where I'm going to be importing images for students. Sometimes the students will have one image, sometimes they will have two or three. I used a portal before to show multiple images related to the particular student, but that was when the information was manually entered. I would copy paste the student id to multiple image records to relate them (I know, scripting). I now need to import the images, haves some sort of custom dialog where the user is prompted to enter the amount of images per student (it will always be the same for all) and upon import assign an incrementing id, but based on the number inputed duplicate the id how ever many times. The duplicate id is to assign that id to that particular student. I know I should use a master record number instead of the student id as a key as we don't always have those and they duplicate, then a separate field for an actual image id's. I'm having problems figuring out how to assign the duplicate id's and if it's going to be overkill-record number (key), student id, image id. More often than not, the images are imported with no student information at all, but we need to have one record show the multiple images for them none-the-less. I was thinking of something like the attached .gif:

Can someone tell me if I'm in the ballpark? Also, a possible example script for creating multiple records with the same serial? I thinking of using Troi for the importing of the images.

ex1.gif

Link to comment
Share on other sites

When you import the images, what information (if any) is being imported that allows you to recognize the image as belonging to a specific student?

Well, unfortunately with this we don't any information. When we have data it's a text/csv file that has an id that associates each image with each student. That hasn't been a problem, it's when we don't. I usually batch import the images into a table, they are assigned a incrementing serial, and there's a relation built to the student table via the another id generated in the student file when a record is created. These are used for proofs to send back which are printed from a form that has the 2-3 images in it. I've just been copy pasting the ID via a script (Go to previous record, focus on id field, copy, go to next record, paste id) so that the next image has the same id so I when I go the layout, it shows the one id and the related images. So essentially I have to assume there's no information for each student, just 2 or 3 images (it's always either all 2 or all 3, never a mix) and a way to produce a layout which shows the 2/3 related images for printing.

Link to comment
Share on other sites

I am afraid I don't understand the basic situation here: how do you know which image belongs to which student?

Well, they are shot in sequence, edited before they are imported to 2 or 3 images so there's exactly the same per student. We don't have to know exactly who the students are for this part of the process, just that Student A has image1,image2, image3, while student B has image4,image5,image6. At this point the students are unknown, but have to be related to the 2-3 images which represent them. They are pulled up in layout with a portal view to the matching generated id and proof is printed with Student A's 3 images, etc... This id is just a incrementing serial. It's not ideal, but it's what we have to work with. So essentially what I'm trying to do:

Batch import from folder

User given prompt: 2 images per student or 3

Serial id generated per unknown student //possibly blank records created matching number of images -calculation (# of images imported) / (number given at prompt)

same serial generate or copied to image table as 10000,10000,10000,10001,10001,10001 //(depending on user input at prompt) -for relating images to student table

Link to comment
Share on other sites

After you have done importing (while the imported images are the found set), replace the contents of the Images::StudentID field with a calculated result =

Div ( Get (RecordNumber) - 1 ; n ) + StartingNumber

where n is the number of images per student (either 2 or 3 in your example) and StartingNumber is the starting number (10000 in your example).

I am still puzzled how you will match this up to actual students, though.

Link to comment
Share on other sites

After you have done importing (while the imported images are the found set), replace the contents of the Images::StudentID field with a calculated result =

Div ( Get (RecordNumber) - 1 ; n ) + StartingNumber

where n is the number of images per student (either 2 or 3 in your example) and StartingNumber is the starting number (10000 in your example).

I am still puzzled how you will match this up to actual students, though.

That worked great setting the serial. Now I need to create blank records in the student table. Can you give me an example of a loop to create blank records in the student table equal to the number of students (not images)? //assuming that would be RecordNumber/n?

I am still puzzled how you will match this up to actual students, though.

With the id set for the images, I can create a blank record in the student table for each student (no information is needed at this time), assign an incrementing serial (same as the starting number from the images) and create a relationship so I can pull the images in with a portal. When we output them, we use a barcode so when they are returned, barcode is scanned-related record found-information about that student is entered.

Link to comment
Share on other sites

The simplest way to do this, IMHO, would be to import the found set from the Images table into the Students table. To prevent duplicates, validate the StudentID field (in the Students table) as 'Unique, Validate always'.

I am still puzzled how you will match up the images AND the blank students records to actual students.

Link to comment
Share on other sites

The simplest way to do this, IMHO, would be to import the found set from the Images table into the Students table. To prevent duplicates, validate the StudentID field (in the Students table) as 'Unique, Validate always'.

I am still puzzled how you will match up the images AND the blank students records to actual students.

Thank you. I self-imported the database and imported the id's and it worked as you suggested. Is that scriptable to avoid so much user interaction?

The actual matching of students is done after. We print out forms with the images on them and a barcode based on the id/serial. The organizations fill out the information and return them, they are scanned pulling up the record and the information is manually entered. From then on, we have information which makes it easier.

Link to comment
Share on other sites

Is that scriptable to avoid so much user interaction?

Yes, of course. It can all be part of the same script: import the images, number them, then import them into Students.

The actual matching of students is done after.

I'm just curious how, because it seems that the pictures are taken with no indication who they belong to. Let's say you have 3 pictures of Bob and 3 of Jim. Your process generates 2 student IDs - but which one of these is Bob and which one is Jim?

Link to comment
Share on other sites

Yes, of course. It can all be part of the same script: import the images, number them, then import them into Students.

Is there a way to self-select the database so that even if it's moved it or the name changes it keeps the import to the other table intact? I used the Import Records [No dialog; "db.fp7"; Add;Mac Roman] and under Specify File, I added the database file. I'm afraid that if the db name changes or move it will break the script.

I'm just curious how, because it seems that the pictures are taken with no indication who they belong to. Let's say you have 3 pictures of Bob and 3 of Jim. Your process generates 2 student IDs - but which one of these is Bob and which one is Jim?

They are shot in sequence. Initially, we don't know who they are, just that X student is shot sequentially. JPG numbers are never reset so that allows sorting to stay intact. Misc images are pruned so that it's always UnknownStudentA->Image1,Image2, UnknownStudentB->Image3,Image4. Since the id's are sequential, as long as it's sorted by ID they stay in order when printed.

Link to comment
Share on other sites

Is there a way to self-select the database

You can set a $variable to Get(FileName) and use it as the path in the Import Records[] step.

They are shot in sequence.

Yes, I got all that. But eventually "UnknownStudentA" needs to be identified as "Doe, John" - doesn't he? I don't understand how this is done - and why it cannot be done from the beginning. It seems like there is a lot of room for error in this process.

Link to comment
Share on other sites

You can set a $variable to Get(FileName) and use it as the path in the Import Records[] step.

Thank you.

Yes, I got all that. But eventually "UnknownStudentA" needs to be identified as "Doe, John" - doesn't he? I don't understand how this is done - and why it cannot be done from the beginning. It seems like there is a lot of room for error in this process.

There's very little error in the initial process as we don't have any information yet, so nothing can be done at the onset other than import images and keep in matching sets (via a unique id). UnknownStudentA is identified down the road as the proof is returned by the organization with all the relevant information filled out, the barcode is used to pull up the id that matches that form and the data is entered and voila, Unknown becomes John Doe. At this point the only room for error is the person typing.
Link to comment
Share on other sites

This topic is 4806 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.