Sign in to follow this  
Followers 0
beckham

Container Field label Lookup

5 posts in this topic

Hi

Can anyone please advise on my following issue.

I have a FM12 file with Container Fields that contain small jpegs, I want to have a text field that shows the title of the image inserted BUT without the .jpg at the end?

 

To explain, If i drag an image named "picture1" and place it in a <<container_name>>

the result is <<picture1.jpg>> how do i prevent the .jpg displaying? I just want <<picture1>>

 

Many thanks

Share this post


Link to post
Share on other sites

Undoubtedly there's a more elegant way, but this would probably do it:

 

Substitute( Substitute ( container_name ; ".jpg" ; "" ) ; ".JPG" ; "")

Share this post


Link to post
Share on other sites

Thanks for the reply Matthew but i can't get that to work?

To display the name i am simply creating a text field <<containername e.g. A1>> resulting in <<picture123.jpg>>

I want it to be <<picture123>>

 

Thanks again

Share this post


Link to post
Share on other sites

OK.  I'm not sure that the '<<' and '>>' means in your question.  I'm assuming that your are not talking about merge fields which use those kinds of brackets to insert variables in a line of text on a layout.  Correct me if I'm wrong.

 

Substitute( Substitute ( container_name ; ".jpg" ; "" ) ; ".JPG" ; "")

 

The calculation above can be used in several different ways to get you the output you want.  One way would be to use it in the definition of a new calculated field that strips the '.jpg' off of the contents of container_name.  You could also use it in a script that strips the .'jpg' off of your text field and replaces it with the new value.  This script could be initiated by the user with  a button on your layout or, more automatically, by attaching it to a script trigger ('On Save') on the container_name field.   

 

The way you implement it will depend on how you would like your solution to behave.  Am I making sense?  

 

P.S.  When you specify the calculation to a script or to a field definition, I'd suggest using the built-in tools for picking field names and commands.  That way you won't forget to add in the table name for related fields  (e.g. Related Table::container_name).  Also you will make fewer syntax mistakes in the commands themselves (or inherit my mistakes). 

Share this post


Link to post
Share on other sites

HI Matthew, Thank You!!..

Your explanation worked perfectly 

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0

  • Similar Content

    • Popout with image contents of a container field
      By Asu
      Hello Mavens, 
      I have a container field into which images can be pasted. I want to create a popout window run by a script, that displays the image in its full size. How do I get the size of the image that has been pasted into a container field?
      Muchas gracias.
    • adding product images in invoices and estimates
      By Markus64
      Hi
      I'm looking to add the picture from the products table to Invoices and Estimates tables.
      Not to successfully yet. 
      What am I missing?
      Thanks in advance for you insights. M.
    • calculation field (container) image not showing on FM GO
      By justakid
      Hi All,
      I created a calculation that resulted in a container image (see below). This is allows me to add/update images without doing anything in Filemaker.
      "imagemac:images/" & S_shot & ".png"
      This works perfectly on the my Mac, but doesn't work on FM go.
      The only way I could get the images to work in FM go was to import the images on a shot by shot basis. I imagine a script could be written to do this, but before doing so, I was wondering if anyone knew if there was a way to make the calculation work.
       
      Any ideas?
    • Filemaker Server Containor Locations
      By Yogi Bear
      Hello,
      We have just moved our FM CRM from being hosted on a P2P network to Filemaker server 14. Going forward we also want to attaché documents to clients.
      As these attachments might be large, it might be an idea to have them stored in an external container. There is a default container linked to the DB but I can't edit it or change the location. (See picture). Ideally I would like to specify a UNC path and have them stored in a separate folder on our Fileserver.
      1. Am I correct that there is no way to change the location, or am I missing something?
      2. Is there way to change the name of the path? i.e. the original DB name was invoices but now is called something else. Where do I look?
      3. What do other people recommend for storage of attachments? Our old CRM generated thousands of files totalling ~ 15Gb over 4 years.
      I just can't seem to find very much info on this topic on google. Feel free to to send me lmtgfy.com link
      Platform: Filemaker Pro 14 / FMS 14 running on Windows 2012R2
      Best regards, JS

    • Photos reduced in size by GetThumbnail appear to take up more storage on FMGo 14 than in OS X
      By folks
      I wonder if the storage for the images remains at the size of the original image taken by the iPad camera
      in spite of the replacement of that image by a much smaller thumbnail.  
       
      From the isolated tests below ( with attached example db )
      it looks like some of the storage in FMGo14 is recovered but not all, double what it should be.
      Also the overhead per container record appears to grow in a non linear manner on both FM OS X and FMGo14.
      Adding photos directly in FM on OS X appears to recover much of the storage that was not recovered in FMGo14.
      Unfortunately, only when another photo is added.  In my solutions all photos are added in FMGo14 so storage
      size grows quite rapidly  :  (
       
      The thumbnails are typically smaller than 1.1MB while the storage consumed for each image within
      the database appears to be average to 3.67 MB
       
      If this theory holds water how to I get the extra storage back as this is causing some real problems
      with sync times.
       
      calculation for container field
       
      // If the content of the container is an image shrink without distortion so max dimension is 1920
      // if it is not an image then return self. This would apply to audio, files and music
      // if image has a largest dimension that is less than 1920 then just use image do not attempt to enlarge image.
       
      If ( PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".jpg" )  or
          PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".png" )  or
          PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".bmp" ) or
          PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".gif" )    or
          PatternCount  ( GetContainerAttribute ( Media;"filename" ) ; ".tif" )
            ;
                  GetThumbnail (
                                          Self ;
                                          If ( GetWidth ( Self ) <  1920 ; GetWidth ( Self ) ; 1920 ) ;
                                          If ( GetHeight ( Self ) <  1920 ; GetHeight ( Self ) ; 1920 )
                                        ) ;
                    Self
          )
       
      Isolated Tests
       
      Created ContainerPhotoTest filemaker db with a single table and single field Media with
      GetThumbnail calculated result
       
      Move to iPhone 5s FMGo14 take photo
       
      ContainerPhotoTest  197 k with no photo
      ContainerPhotoTest  1.7MB with single photo
       
      Export Photo to desktop from Container
      Photo Size 467 KB
       
      But the database storage size has increased by 1.699 MB
       
      Add 8.6MB .jpg from the desktop in a second record
       
      ContainerPhotoTest  1.3 MB in size
      Drag photo to desktop from container
      Photo Size 623 KB
       
      ( 197 k + 467 k + 623 k ) = 1287 k 
      1,300 k - 1287 k = 13 k extra space used.
       
      What is happening here.
      So it looks like it works fine on OS X but perhaps not on iOS
       
      Try again with iPad Air 2 iOS
        • ContainerPhotoTest  1.3 MB in size
        • Take photo from FMGo14 Container
        • Take similar photo on iPad camera app
        • Photo Size 2.6 MB
        • ContainerPhotoTest 2.1MB in size
        • photo 800 k size increase
        • Photo size 467 k
        • Close and reopen FMGo14
        • ContainerPhotoTest 2.1MB in size
       
      So it seems that in iOS some space is recovered on the photo re-size but not all.
       
      Final Test on OS X
        • Create new record and.
        • ContainerPhotoTest 2.1MB in size
        • drop similar photo 2.2 MB into container from desktop
        • ContainerPhotoTest still 2.1MB in size, no increase in size...
        • Quit and re open database
        • ContainerPhotoTest still 2.1MB in size
        • drag new photo to desktop 467k
       
      ( 197 k + 467 k + 623 k + 467 k ) = 1754 k
      2,100 k - 1754 k =  345 k extra space used
       
      So it looks like something different is happening on OS X and FMGo
      I need to gather data including photos on FMGo and in practice as noted
      in the initial description of the production solution where no photos are added in OS X file size grows
      quite quickly.  
      ContainerPhotoTest.fmp12