Jump to content

Script to import photos returning Null


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

Recommended Posts

I have been using the following code for several years on a database that brings in student pictures. Now I have built a database that keeps track of "Magic The Gathering" cards. But the script keeps bringing up zero imports. The following code is put in a calculation field. This code points to a container field called images.   Here is the code:

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) 
)


Here is the container field code:

"imagewin:/C:/Photos/" & Magic::MagicID & ".jpg"

I have the pictures listed on my drive as C:/Photos. So I go to import, point to the folder and check subfolder and import by "matching found sets", image > images, filepath = MagicID. Been doing this for several years on the student database without a problem. The only difference I see is that the studentID is a set 6 digit code. The card digit can be from a 4 digit number to a 10 digit number. But for now I am just testing it on 4 digit numbers and I keep getting 0 imports. They are .jpg files. The same extension I use in my student database. I know this long just trying to cover all questions. Thank you.

Link to comment
Share on other sites

Hi,
Have you checked the values in fields filepath and MagicID are having common values ? If not then, please do a manual search for the same at least for 2/3 records so you can able to confirm that there having some records in your old database for MagicID value in new database. I think there are some values missing in new database due to which the field value of both the fields are not matching and finally the import result giving zero output. Can you post few data in field filepath from old database vs MagicID from new database, so it will easy to look into your problem.


Thanks,

Link to comment
Share on other sites

Hi,

Have you checked the values in fields filepath and MagicID are having common values ? If not then, please do a manual search for the same at least for 2/3 records so you can able to confirm that there having some records in your old database for MagicID value in new database. I think there are some values missing in new database due to which the field value of both the fields are not matching and finally the import result giving zero output. Can you post few data in field filepath from old database vs MagicID from new database, so it will easy to look into your problem.

Thanks,

I found my problem. It was a value marked wrong. It works great now.

Link to comment
Share on other sites

This topic is 4016 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.