5 Replies Latest reply on Apr 19, 2016 2:56 PM by Charlesdh

    Loop thru Images

    Charlesdh

      I'm trying to loop thru  "Image Name field" to see if the Image exist for a "Product". If the Image name is missing I need to combine the "Product Name and VT" the "VT" is part of the Image Name. VT has its own field. So if I had a Product with this identifier "11DU1002" and the VT has "21342". The end result would be "11DU1002 21342.jpg"

      Any help with this would be great!

       

      Thanks

       

      Charles

        • 1. Re: Loop thru Images
          erolst

          Not sure why you want to loop; to find records with an empty “image name” field and set a value try

           

          Enter Find Mode [ no pause ]

          Set Field [ field: YourTable::imageName ; specify result: "=" ]

          Set Error Capture [ on ]

          Perform Find [ no restore ]

          If [ Get ( FoundCount ) ]

          Replace Field Contents [ no dialog; YourTable::imageName ; YourTable::Product Name & " " & YourTable::VT ]

          End If

           

          Of course, you could simply define a calculation field, result type text, say, cImageNameForExport, as

           

          YourTable::Product Name & " " & YourTable::VT

           

          to automatically have this result in all records …

          • 2. Re: Loop thru Images
            Charlesdh

            HI,

             

            I have a Image file that has images as ".PNG" and "JPG". Can you use a wild card instead of having to put "JPG" or "PNG" in the calculation?

             

            Thanks

            Charles

            • 3. Re: Loop thru Images
              erolst

              Though I'm not really sure I understand what you mean, I respond by saying “probably”, because almost anything is possible with FM.

               

              Maybe give a concrete example.

              • 4. Re: Loop thru Images
                Charlesdh

                Hi,

                 

                I have several images as below.

                 

                "19DH1007 1209.JPG"

                I also have Images as

                "20DH2002 3214.PNG"

                I have a calculation field as you suggested above as

                "Product::ProductName & " " & Product::VT & ".PNG"

                I'm looking to see if I can use a wild Card instead of the "PNG or JPG"

                 

                Thanks

                • 5. Re: Loop thru Images
                  Charlesdh

                  Hi,

                   

                  I was able to convert all of my Images from ".JPG" to ".PNG". I used excel vba to do this.

                  However, I would still like to know if I could use a "Wild Card" for future information.

                   

                  Thanks

                  Charles