Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Importing mass pics using imagewin but working by text identification

Featured Replies

I have a script that I found about five years ago but do not know where. It has been working great until now let me explain. I have a database of students that we always match the pictures up by their student ID so that was easy. I would use as follows:

 

In my field I would create an "image field" and make it a container then I would click on options and put in the calculate field I would put:

 

"imagewin:/c:/Photos/" $Students::StudentID & ".jpg"   So the picture of the student also was identified by their ID number not by name. This has worked for 5 years and still does. The problem I have now 

 

though is that we created another database and we want to bring pictures in by their name because this group of students does not have a student ID but they each have a unique name. So their pictures are identified by name. So I did this:

 

"Imagewin:/C:/Photos/" & Students::StudentName & ".jpg"   When I import it says it import 0 out of 0. It will not import any pictures. Any ideas?  Thank you. 

Where exactly does import come into play here? Or a script? All you have described is a calculation field.

  • Author

I apologize. Here is the script:

Let
(
[
// Transform the contents of a container file name Images into text
ImageRef = GetAsText (ImagePath);
Photos = Position (ImageRef; "/"; 1; PatternCount (ImageRef; "/"))
];

Middle (ImageRef; Photos + 1; Length ( ImageRef) - Photos)
)

I am afraid I am still not with you.

  • Author

Yes let me be more specific. I can understand that it is fragmented. I have table named "Players" in the table I have two fields that relate to the image. 

One field is "Imagepath" which is a calculation which is where i put the following.

Let 
( 
[ 

// Transform the contents of a container field named Images into text 
ImageRef = GetAsText ( ImagePath); 
Photos = Position ( ImageRef; "/"; 1; PatternCount ( ImageRef; "/")) 
]; 

Middle ( ImageRef; Photos + 1; Length ( ImageRef) - Photos) 
)

The calculation result is a number. Then I have a field called "Images" which is a calculation and that is where the following is put.

"imagewin:/C:/Photos/" & Players::PlayerName & ".jpg" 

So this works perfectly if I relate the pictures that have the student ID such as 111111 to the field in the students record that has the ID 111111. But now we have another database and we want to correspond the pictures which are labeled with their name to a corresponding field in the database that has their name but we are coming up with 0 when the import is done. Hope that makes sense now. 

No, I am afraid I am getting more confused as we go on. If you have a folder of images, where each image is named the same as a Player in your Players table, then a calculation field (result is Container), defined in the Players table as =

"imagewin:/C:/Photos/" & PlayerName & ".jpg"

should display the corresponding image. No other calculation field, or script, or import are required for this. If the field does not display the expected image, then either the image does not exist or the real name of and/or the path to the image are different from the calculated ones.

  • Author

I am also confused. Because if I change the pictures to a correspond with a unique ID number on the layout the pictures show up. Just will not do it with the user name. 

Maybe it is a screen resolution thing but it looks like there is a space before .jpg

Try ".jpg" not " .jpg"

  • Author

Thank you for you help. But there was not a space in between. The script works if I have correspond to a number on my layout just not text. This is baffling. I have tried putting an underscore between first and last name I even put them together without a space but nothing. 

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.