Experiences of a FileMaker Pro Database Developer

Creating QR Codes with FileMaker

FMP QR Code

QR Code

The QR Code is becoming more popular in everyday use, especially when used with smart phones to quickly launch a website for more information. The website could be anything from more information about the product you are looking at, the daily lunch specials at the restaurant you just passed or more information on a house for sale that you saw driving by.

Using Google’s Chart API for QR Codes, Custom Functions and the ScriptMaster plug-in by 360Works, I created the FileMaker Pro QR Code Creator. There are 2 options for displaying and creating the QR Code:

  1. Create QR Codes in Web Viewer
  2. Store a QR Code as a PNG file in a container field

Each option uses a different custom function. I was hoping to generate the QR Codes with a single CF, but the Web Viewer’s automatic encoding makes it basically impossible.

UPDATE 4/30/2011: I just updated the file so the plug-in function is now loaded within the custom function instead of having to call a separate script. All you need to do to make this work in your own solution is to install the ScriptMaker plug-in and to import my “QR_Code_Container” Custom Function from my example file below.

UPDATE 5/16/2011: Thanks to Daniel, he discovered that it’s required that my sample file is open before you import the Custom Function. If my sample file is not open when you import, the Custom Function will be commented out and missing the ScriptMaster GetURLAsContainerpart2 function.

UPDATE 1/21/2013: Google seems to be changing the API for QR Codes. I updated the link above, but it looks like QR Code generation may no longer be supported after 2015. The file still works as expected, but I am not sure how Google’s future changes may impact the function of the file. I will try to dig into this and if anyone else has further information, please let me know.

UPDATE 3/7/2013: Thanks to Bill, he helped me discover that I needed to clarify that not only is it required to open my sample file, but you MUST create a QR Code in my sample file first, before you import the Custom Functions. Creating a QR Code, or just changing one of the fields that is used to generate the code, causes the Custom Functions to load. If they do not evoke the Custom Function first, you will get  <Function Missing>( $url & $dim & $data & $encoding & $error & $margin ), instead of GetURLAsContainerpart2( $url & $dim & $data & $encoding & $error & $margin ).

You can download the fully opened, unlocked example file here:

QR_Code_v1.1

If you have any comments, questions, suggestions or problems with the file, please post a comment. Although I have done the best I can to create a file that works, is bug free and generates a code that is expected, use the file at your own risk and there is no implied warranty protecting data loss or the accuracy of the code generated.

Post to Twitter

Comments

  1. I downloaded your QR Codes file and it works beautifully, thanks for posting it. I’m trying to now load the solution onto our server but not having any success. I’ve loaded the plugin onto the server machine and copied the custom functions and calculation into a hosted file, but the only result I get in the container field is a question mark. Any advice you could pass along would be appreciated.

    • Hi Rob. Thanks for the kind words and I’m glad you found it helpful. Now let’s get it working in your solution. Is the ScriptMaster plug-in also loaded on the local FileMaker Pro Client machine? Server installed plug-ins are used for 2 purposes only; 1) to update the plug-in on client machines with auto update and, 2) to be used when running server-side scripts. FileMaker Pro on a client machine cannot directly use the plug-in on the server. Once you install the plug-in on the FileMaker Pro client, give it a try and let me know if things are working.
      Hope this helps!

    • Rob and I communicated back channel and we tracked down what the problem was. I’m glad you got it going Rob! The specific function we are using from the ScriptMaster plugin must be registered. A script has to be run to do this. See my on open script in the file, “Load ScriptMaster Get URL as Container.”
      The specific command is:
      RegisterGroovy( “GetURLAsContainerpart2( url )” ; “new URL(url);”; “isGui=false” ) = “ERROR”
      You can set a variable or use in an If statement and check for error.

      • I just updated the file so the plug-in function is now loaded within the custom function instead of having to call a separate script. All you need to do to make this work in your own solution is to install the ScriptMaker plug-in and to import my “QR_Code_Container” Custom Function from my example file. See post for details and updated file.

      • Hello Matt.

        Thank you for your QR Code function.
        It works perfectly in the file I downloaded, but I could not get it working in my solution.
        I read the comment from Rob, sorry but I was not able to figure out what “See my on open script in the file, ‘Load ScriptMaster Get URL as Container.’ ” mean.

        I try to find out the open script but I found none scripts.

        Could you, please, help me with this problems?

        Daniel – Aichi, Japan.

        • Hi Daniel, Did you import the custom functions into your solution? You will need FileMaker Pro Advance to do this. I updated the solution and custom functions so you no longer need to run a script in order to load the and register the plugin. The custom function now registers the Scriptmaster plugin. These should be the 3 basic steps: 1) Install the ScriptMaster Plugin; 2) Import my custom functions; 3) Define a calculated container field using my custom function QR_Code_Container ( Data ; Width ; Height ; Encoding ; ErrorCorrection ; Margin ). Make sure the calculation is set to container. What do you get in your container field? Let me know if this helps.
          All the best, Matt

  2. Hi Matt.

    Thank you for your quick reply. :-)

    I have done as you wrote, and just to be sure, I downloaded the 360 ScriptMaster again and re-install it.
    I also copied the custom functions (both) and the table from your file “QR Code.fp7″ too and I got a empty blank field without QR Code or question mark.

    I am running FM pro Adv 11.0v3 and Windows XP Pro SP3.

    A few hours ago I was trying some scripts on 360 Works ScriptMaster and I got a message saying that “java [something] (I don’t remember) was not working (or not installed)”.
    By the way, the ScriptMaster I am using is the free version, is it OK?

    Daniel – Aichi, Japan.

    • Hi Daniel, If you open my sample file, do you see 2 QR codes displayed? One in the Webviewer (left side) and one in a container field (right side)? If not,iIt’s possible that Java is not installed or working on your XP machine. Is ScriptMaster showing up in your plugin list, and is it showing up checked? Do you have any other plugins installed? Try removing all other plugins, and make sure that you have at least Java 6_22 installed. What do you see if you direct a web viewer to http://javatester.org in your FM11? I suspect that java may not load, which may be from an old plugin being installed with your FM11 and causing a conflict launching java.
      Let me know, Matt

  3. Hi Matt.

    Yes, I can see both QR Code in your sample file (web viewer and container field).
    I have another plugin installed and I remove it and tried again, but without success.
    My java version is 1.6.0_25 from Sun Microsystems.

    Daniel.

    • Hello Daniel,
      OK. So now let’s trouble shoot this from the point of your file. Did you import my custom function or did you copy paste parts and create new? Delete it if you did not import it and then import from my file. All you need is the QR_Code_Container function. Then in define fields, change your calculated container field or create a new test one and paste ONLY this into the calculation: QR_Code_Container ( “http://thebusinesshelper.com” ; 140 ; 140 ; “” ; “” ; “” ). Does this display a QR Code?
      Matt

      • Hi Matt.
        I imported the custom function from your file, I did not copy and paste it.
        I created another calculation field as container and copy and paste the calculation QR_Code_Container ( “http://thebusinesshelper.com” ; 140 ; 140 ; “” ; “” ; “” ) but still a blank field.

        Also I have tried it on another computer with WinXP pro SP3 and get the same results, but in this second PC the FM pro is 11.0v1 and there is only one plugin the ScriptMaster.

        Daniel.

        • Hi Daniel, sorry so much trouble. I’m not sure what’s happening. Can you create a brand new database file, import my custom functions and create a single calculation container field set to QR_Code_Container ( “http://thebusinesshelper.com” ; 140 ; 140 ; “” ; “” ; “” ). Do you still get blank QR code in container? If so, please email me the file. I will send you my email address in a direct email.
          Thanks,
          Matt

          • Hi Daniel,
            I received your sample file and the problem is with the custom function. Open it and take and look and you’ll see that it’s commented out and you’re missing the ScriptMaster generated function. The command that creates the QR code looks like this in your file:
            ( $url & $dim & $data & $encoding & $error & $margin )
            but, should be this:
            GetURLAsContainerpart2( $url & $dim & $data & $encoding & $error & $margin )
            The GetURLAsContainerpart2 is the function created by ScriptMaster. ScriptMaster allows you to create custom Java functions, but these are not part of the standard functions installed with the ScriptMaster plugin. In order for my custom function to be imported correctly, the ScriptMaster GetURLAsContainerpart2 must be created first. To do this, open my sample file and leave it open, then import my custom functions. In my custom function I automatically create the GetURLAsContainerpart2 function too, so you will not have to worry about this once the custom function is properly installed.
            I’ll make a note of this in the instructions so hopefully we can avoid this problem for future implementations. Thanks for your patience.
            Please post a reply letting me know that this solved your problem.
            Thanks,
            Matt

  4. Hi Matt, I forgot to comment that I am using the container field, but now I tried the webviewer too and the webviewer is working but not the container field.

    Daniel.

  5. Hi Matt.

    Thank you for your time and patience.
    Now the QR Code function is working, amazing. :-)

    Thank you very much!!!!
    I really appreciate it.

    If you plan to write a book with some tips and tricks for Filemaker, just let me know.
    I want to have one copy, with an autograph would be better :-)

    Once again thank you very much.

    Daniel – Aichi, Japan.

    • Hi Daniel,
      I’m glad you got it working. Thank you for the kind words too. I wish you the best in your FileMaker development work. Enjoy!
      Based on your testing and implementation, I may create my own plug-in using ScriptMaster so the GetURLAsContainerpart2 is automatically loaded when the plug-in is installed. I’ll do some more testing and see if I can prevent this issue from re-occuring in the future.
      All the best,
      Matt

  6. i’ve been banging my head around generating these codes…and after just an hour after finding this page, i’ve learned about custom functions, importing them, using them, modifying them etc etc…and everything works FANTASTICALLY! Thank you thank you thank you thank you thank you thank you etc etc

  7. Well it looks all promising, but there is a lot of implicit information here and though I do understand that I may have to initialise a ‘custom function’ You have forgotten for the readers of this page who need explicit information, how exactly that should be done or formulated.

    I see this here

    RegisterGroovy( “GetURLAsContainerpart2( url )” ; “new URL(url);”; “isGui=false” ) = “ERROR”

    and that includes several ” signs (these often cause problems when taken from a web page with cut & paste.

    Then my guess is that this statement should be a script triggered when opening your example file and that this statement possibly should go in the ErrorCorrection field. But the script editor does not want to eat the Register string…

    All the while the container fields displays an error Missing ScriptMaster plugin, though I did install this script and checked in preferences if it has been recognised, which was correct.

    Then you write somewhere that you have a version which includes this opening script, or at least I read it as such, but this web page download fp7 file does not have it. Why not I ask myself, makes life easy…

    A further reading brings me to suggestions of disabling other plugins, something which makes your nice idea worthless to me, as I use may plugins in my solutions (troi, insidescan and so on).

    Last the webviewer example works in the original record…. I tested a simple URL with an anchor and then it seems to me that the anchor data starting with the needed # is thrown away… at least when I test it with my iPad app QR-Reader HD.

    I have started to use QR-codes for some experimental immersive projection systems at the School of Creative Media in Hong Kong… having overlays in a circular projection system of 1024 x 8192 pixels8 meters wide, works nice… with several users using their mobile devices (ALIVE Lab AVIE system). Doing another project with big murals on history of media which have embedded QR-codes with a hundred or so sources… this made me find and try-out your FMP QR tool…

    I would appreciate your help… working with Filemaker for two decades but I am not practical with registrating Custom Functions and the like (apparently) Nice greetins

    • Hi Tjebbe,
      Sorry you have had trouble. Here are a few things you can try. Please keep me posted.
      -1. You need FileMaker Pro Advanced to use Custom Functions.
      -2. Make sure the ScriptMaster Plugin is installed
      -3. Download and open my sample file. Verify both the Web Viewer and the Container Field are displaying the QR Code.
      -4. Duplicate the record in my sample file and input a new URL. I tried this URL with an anchor point and it worked in the container field (http://imaginarymuseum.org/TJCV.html#visualsummary). However, the WebViewer generated QR Code does not work, it drops the # character. I’ll look into this and see if it’s an encoding issue.
      If either of these steps above don’t work, something is not installed correctly or configured correctly. Let me know if the above works.
      Next, in order to get the custom functions into your solution, I recommend importing them from my sample file. It’s important that if you edit the custom function that the Scriptmaster plugin is installed first, otherwise this line in the CF will be invalid and the function will not work:
      $plugin = RegisterGroovy( “GetURLAsContainerpart2( url )” ; “new URL(url);”; “isGui=false” );
      In my updated Example file, V1.1, there are no scripts. Everything is handled in the Custom Functions.
      Let me know if any of this helps, Matt

  8. You sir are a god. Superb work. I’m saluting you so hard it hurts.

    This is precisely what I need.

    Thanks :)

  9. Hello \
    after following wat everybody has done…i stilll just cant figure out how did u import the custom functions i m using a mac os and i cant see the web viewer too….i just cant figure out how should i be incorporating wat u have done into mine…i have the script master too…but its a big confusion….i did the get url to container as a plugin the field comes blank with error…

    • Hello Pri,
      First, do you have FileMaker Pro Advance (FMPA)? If not, you need this version of FileMaker Pro. You cannot edit or create Custom Functions without it. If you have FMPA, open my sample file first. Then in your file, go to FILE, MANAGE, and select Custom Functions. Click the Import Button and choose my sample file. Then select my two custom functions and import them into your solution. Make sure the QR Codes display and work correctly in my sample file before you attempt to import into your solution. If they do not work and display in my sample file, the ScriptMaster plug-in is not installed correctly.
      Let me know,
      Matt

  10. Hi Matt,

    I am going to be getting the FMPA today, But one questions
    if i anyway import the custon function in that as u said QR_Code_Container ( Data ; Width ; Height ; Encoding ; ErrorCorrection ; Margin )Could i give the data for the QR code as a unique ID i.e. a number put in by the user and if it would generate the QR barcode or is the url necessary for the QR barcode to be generated …

    • Hi Pri,
      Excellent. Let us know how it goes. You can enter any data in the Data variable. In my sample file this is the Data field. A URL is not necessary for this field. However, since I use Google’s Chart API in my custom function, you do need a connection to the Internet in order for a new code to be generated. Once the QR Code is in the container field, anyone can view it.
      I do not know if it’s possible to copy Google’s Chart API and use locally. This would have to be investigated.
      Hope this helps,
      Matt

  11. Hi Matt,
    First of all, Thank you very much for your great job, 2nd Thank you for your sheering.
    I did all your ways u said, and it’s does work very well in my FM 10, it was really exciting and helpful for me.
    Thank again and have good time.
    Darius

  12. Hi Matt,

    We’ve had trouble with webviewer’s URL encoding rules – so this is a godsend (or it will be when we get it working!). Our QR code (generated by chart.googleapis.com) contains a URL (docs.google.com/spreadsheet/viewform etc) that has a parameter &entry_5=xxx (this “pre-sets” a field on a form to a filemaker database value that gets captured into the QR code).

    The full url that works (pasted into the browser) is

    https://chart.googleapis.com/chart?chs=200×200&cht=qr&chl=https://docs.google.com/spreadsheet/viewform?formkey=dDB1eEZsNktvQ00xZ2s0aXRWT1AwX0E6MQ%26entry_5=XXX

    As mentioned viewform’s aggressive URL encoding wont let the “parameter” pass in good shape… So, we have taken your advice and downloaded 360. Sadly, we dont have Filemaker advanced so we cant get to your custom functions… but we dont actually need the flexibility you provide – all but the “parameter” are hard-coded.

    If we create a calculated field using GetURLAsContainerpart2 using that URL all we get is “0″ displayed. Not the image of the QR code we are expecting.

    Have we misunderstood something basic here?

    Any help gratefully accepted.

    Thanks! Sharon

    • Hi Sharon,

      So, what’s the actual parameter, the “xxx” or “&entry_5=xxx”? In other words, what are you specifically “substituting” in the URL with data from your database? Is that just a numerical value or what kind of data is the parameter? Did you try with my sample file? If I paste your URL above (only this part: https://docs.google.com/spreadsheet/viewform?formkey=dDB1eEZsNktvQ00xZ2s0aXRWT1AwX0E6MQ%26entry_5=XXX) in my sample file, the QR Code is generated. You should be able to reproduce regardless of using FileMaker Pro Advanced or not. The Custom Functions are loaded with my sample file, you just can’t edit them, but they are available in the calculation box. You just need to set the width and height to 140 each in order to properly display the code in my container field on the layout, otherwise it scales the code.

      I highly recommend FileMaker Pro Advance if you are doing any development work. The script debugger, data viewer, custom functions and custom menus make it very worthwhile. I’ll see if I can create a version that does not require custom functions.
      All the best,
      Matt

  13. Hi Matt

    Firstly thanks so much for designing this, and also for replying so fast!

    In the “&entry_5=xxx” the XXX will be the organisation name – just a text field. I only need one QR code per record, and I want the organisation name to be auto-populated into the google form which is the destination that the QR code sends you to. (That’s what “&entry_5=organisation” does.)

    It works fine in your sample file. Is there a way I can access the custom function for my own file without FM Advanced?

    Thanks again for your help!

    Sharon

    PS I had replaced the & with %26 as an attempt to get it to work. The & works better, so now the URL is;

    https://docs.google.com/spreadsheet/viewform?formkey=dDB1eEZsNktvQ00xZ2s0aXRWT1AwX0E6MQ&entry_5=XXX

    • Thanks Sharon. I will put a version together that does not use the Custom Functions. It might take me a day or two to get it together.

  14. Hi again Matt,

    I’ve had your custom functions imported for my be my webhosting people (they have FM Advanced and I don’t.)

    I’ve got the webviewer working(which doesn’t solve my problem of needing a “&” in the URL), but I just get an empty box for the container.

    I have GetURLAsContainerpart2( url ) but I couldn’t find
    new URL(url);”; “isGui=false” );
    in Scriptmaster 360? Have I misunderstood something?

    Any suggestions?

    Sharon

    • Hello Sharon, 2 things. First, the ScriptMaster Plugin MUST be loaded and my sample file MUST be opened before you import or copy the Custom Functions. If you don’t do this, the Custom Functions won’t work properly.

      Second, you do not need to use the ScriptMaster Plug-in functions once you have my custom functions. Just use my custom Function, QR_Code_Container ( Data ; Width ; Height ; Encoding ; ErrorCorrection ; Margin ) and feed in the appropriate parameters. The parameters are defined in my example file. Some are not required. Your URL with your organization name must be in the data parameter, so this should be a calculated variable.

      Let me know if this works or you have more questions. As mentioned in my other reply, I’ll also try to get a version up that does not have the Custom Functions.

      PS. Forgot to mention that when using my QR_Code_Container function, the field needs to be a calculated field of type Container. Or, you need to create a script that sets a Container Field using my function.

  15. Is there any update to this Custom Function since QR_Code v1.1?

    • The current version is 1.1. Are you having problems with it?

      • Yes. FMPA 11.3 Windows XP, Java is installed correctly. I opened your demo file and imported the custom functions from your demo then copied the fields from your demo directly into my database. I can generate the QR in the Web Viewer and it works great. The Container field will not display the QR and the custom function reads…
        <<
        Case (

        //Trap for error registering plug-in Function
        $plugin = "Error"; "ERROR¶Problem Registering¶Function";
        //Trap for missing plug-in
        $plugin = "?"; "ERROR¶Missing ScriptMaster¶Plug-in";
        //generate QR code
        ( $url & $dim & $data & $encoding & $error & $margin )

        )
        >>

        I have Scriptmaster (latest posted version) running.

        This appears to be the same problem that “Daniel” had. He got it working somehow but the solution was not posted.

        • Hi Don, if you look at my post again, I have a paragraph entitled “UPDATE 5/16/2011″ (http://fmprodb.com/197/creating-qr-codes-with-filemaker.html), where I explain that my sample file MUST be open before you import it. This is a critical step. The sample file must be open so the custom function runs first in order to register the Scriptmaster RegisterGroovy function called GetURLAsContainerpart2( url ). YOu cannot just import the custom functions without the sample file be open. If this still gives you a problem, please let me know. Thanks.

          • Matt, Thank you for your response. We had had the QR_code database open prior to opening our own local solution. In fact we tried the process several times. (only 20 years with FM)

            Finally, without further explanation the QR_code custom function began to provide us with return images in both the web viewer and the container where we had seen only QR_codes in the web viewer to this point.

            I feel, as a long term developer, that it is imperative to document steps of processes when new code, functions, field definitions etc are inserted to a running and functional solution. Perhaps some of the following steps are unnecessary for other Users.

            We completed the following steps:
            01 unchecked ALL plugins from our open copy of FMPA
            02 closed the FMPA application
            03 downloaded the current Scriptmaster plug-in again from 360 Works
            04 installed the Scriptmaster plugin in the Extensions folder of our local FMPA installation and restarted FMP
            05 opened your QR_code solution and checked to be certain that Scriptmaster was now running
            06 opened our own solution in FMPA
            07 imported BOTH custom functions from your QR_code solution
            08 then, copied the fields from your QR_code solution to the working table of our solution
            09 we closed both the QR_code solution and our local solution
            10 restarted our own local solution and re-enabled our other plug-ins

            result ….. we generated 8500 QR_Codes customized to our website product page URLs in about 20 minutes

            The process to generate the customized QR_Codes is now automated within our system and the Codes are automatically inserted in product summary pages.

            The QR Code implementation that we have completed will, in the near future, enable our Users to quickly scan a product page in a warehouse or transportation emergency response manual and then be taken immediately to the product specific webpage on our site for further documentation on a specific product. It will no longer be necessary to place hundreds of pieces of paper into the response manual if the operation can be equipped with a smartphone or similar device capable of running a Tag Reader.

            In our effort to implement QR Codes in our own FMPA database we did find one other (not so easy to implement) solution by Andries Heylen of BH&A in Belgium http://www.bh-a.com. This application also utilizes the 360 Works Scriptmaster plug-in. Mr. Heylen’s solution contains some interesting features that other visitors may find useful.

          • Hi Don,

            Thanks for your thoroughness here. I too have been developing in FileMaker for just about 20 years now. Starting this year, I actually accepted a full-time job with one of my good clients, so I’m slowly closing down my consulting business. A definite change in scope, but I’m looking forward to it.

            I’m sorry you had such problems implementing the custom functions and I thank you for the 10 step check list. I did not experience the problems you had. With this QR project I did try pushing the envelope a little bit by registering the plug-in within the custom function. Originally I had a startup script that did this.

            I’m thrilled that you got it working and that it’s being implemented in a real world environment.

            If you have suggestions or ideas for improvement in v2.0 update, let me know. You might also want to check out what another Northeast developer, Agnes Riley, created for a QR solution also using ScriptMaster 360, http://www.zerobluetech.com/blog/what-qr-codes-are/.

            All the best,
            Matt

  16. oh well, the blog is stripping everything out …. ….”Function Missing” prior to the parameter string in parens.

  17. Can a QR code generated in one database be used to create a matching record in a second database? For example, an inventory record number is generated by a database for an asset that is being received. That database then (theoretically) generates a QR code that is applied to the asset that when scanned, opens a new record in a FileMaker database that automatically enters the corresponding inventory record number and can accept new data for that asset. Is this possible with FileMaker and QR codes?

    • Hi Dan, I’m pretty sure it could although the QR code that I’ve setup is primarily URL based. However, what you are trying to do can be done with simple barcodes. For one client we actually developed a system for Quality control where each piece being tested was barcoded. This actually happened in the production side as the product was being built which the build out is also on FileMaker and the barcodes which are basically serial numbers are generated. When QC scans the product, a new record in the QC table is generated or it finds an existing record if QC failed or was not complete. You’ll just need to setup a barcode scanner as an input device on your computer running FileMaker Pro. This could also be done with FileMaker Go on the iPhone or iPad using the camera on these devices as the scanner.

  18. Hi Matt, bravo ! it works really great !
    Do you know how to create a Contact QR Code, with a First Name, Last Name, Phone num and Email Address, which allow to create an iPhone contact after been scanned ?

    Regards,
    Vincent

  19. topherson says:

    Matt,

    Your work here has me inspired. I have downloaded the Script-Master plug-in and your sample file. I can generate codes of webpages without issue but when I try to format a vCard, the code image returned does not scan. I’ve searched high and low and found a url encoded vcard string at http://fisherwebdev.com/wordpress/2010/05/21/vcards-as-qr-codes-with-google-image-chart-api/
    I’ve tried creating a new database that has a field for the encoded url string and a webviewer linked to it but the qr code returned is not formatted correctly. I was hoping you might be able to shed some light on how to adapt the vCard formating into your solution or explain why the webviewer doesn’t work with the string.

    best, Topherson

  20. Tried implementing with a catch. The “Data” field is a calculation of concatenated existing data. When doing so, the qr code does not show. If I create a text “Data” field and just enter information, it works perfectly. ??????

    • Hello Jim,
      Is the calculation of the data field formatted as text? If you have FMP Advance, you can use the data viewer to help review the calculation. I will bet there is a subtle difference. As long as the calculation is outputting the exact same string as what you enter manually, it should work. I just tried using a calc field for the Data string and it worked.
      Send me an example of your Data string if you need further help.
      Good Luck,
      Matt

      • formatted as text, but has carriage returns, etc. :

        customer & ¶ &
        “P/N: ” & partid & ” REV: ” & revision & ¶ &
        “PO: ” & po & ” LI: ” & poli & ¶ &
        “QTY: ” & qty & ¶ &
        “LOT: ” & lot & ¶ &
        “LDC: ” & ldc

        I’ve made a script that sets the “data” field used in the qrcode function to the concatenated text field and it works fine. just an extra step to create the code.

        • Hi Jim, your carriage return operators, the paragraph symbol (¶), must be encased in quotes in your calculation. Try that and see if that helps.
          Matt

          • did not solve the problem. I’m put of ideas…

          • Now all of a sudden, I’m just getting the word “error” in the container on my layouts.

          • Hi Jim,
            Did you get the sample file that I sent you yesterday? Look in your junk folder if you did not get it. It’s from matthewg at thebusinesshelper.com. I created an example using your fields. The error is usually caused by the Scriptmaster plug-in not installed in FileMaker. Could also be a result of the custom function if it was not imported correctly.
            Let me know,
            Matt

          • I did get the file but, unfortunately, we are on FM11 and I cannot open a FM12 file. All fields in the calculation are text fields or number fields. I’ll try the getastext function to see if that helps.

          • Oh, sorry about that. I wasn’t thinking what version I was using when I made the changes.

          • I think that I’m now having trouble with plug-in registering. I’m using a networked database (FMP server). I opened the database on my client machine using FMP Adv and registered the plug-in and added the custom function to the database. Now when I run the database on my client machine using FMP (non-adv), I get the plug-in error.

          • Every client must have the Scriptmaster plug-in installed. Is it not working with the plug-in installed? You do not need to do anything with the custom functions since that is built into the database on your server, but you do need the plug-in on each workstation.

          • I’m just trying this out on my client machine, then will implement out to the other clients when ready.
            I do have the scriptmaster plug-in installed, and it appears to be running (FMP-edit-preferences-plugins, 360works Scriptmaster is checked). The AutoUpdate plug-in is also checked.

            sorry to be a pest, but I think the QRcode potential is great so I’d like to get this implemented!

          • I disabled the 360works scriptmaster plugin. Then went to re-enable it and i get a message saying it cannot be enabled. ????

    • I changed the permissions on the plug-in .fmx file and now I can reenable the plug-in. The functionality still does not work, though, i.e. “error” in the container field.

      (I previously replied this to the wrong thread – sorry)

  21. Please let me know of any updates, cause im also willing to work with this database function, If you have an updated version or a variant I would like to have it, thank you very much.
    P.S. Is the Google Chart Api for QA Codes still working? i get an ERR 404 on the link

    • Hello Andres,
      Sorry for such a late response. There is no updated version. As far as I know it’s still working with the Google API. I just tested today and I did not get any errors. Send me an example URL and I can check.
      Matt

  22. Hi Matt —
    The QR code filemaker custom function is very cool. My question is: “is there a (simple?) way to create a QR code for a Map URL? In other words, If I were to use a URL construct for maps.google.com/whatever-the-url-is-for-a-google-map-URL…. and have this maps.google.com/URL be encoded as a QR code?

    My goal is: have a map on the screen, and if I want to pull the map up on my mobile phone, I just scan the QR code being displayed on the screen and it launches the maps app on my (i)Phone (or android, etc.) and… voila! I am now viewing the map on my phone just by scanning the QR code.

    I’ve been hunting around to see how on earth to get this done. It seems like your custom function is the closest I am getting but I seem to be missing the last puzzle piece to actually get a URL for a map to read in a QR code. When I give the QR code “encoder” a maps address, it appears to get messed up with spaces, etc.?

  23. Thanks for sharing this great solution. Just a note on implementation… Since this custom function creates a new custom function on the fly, it confuses FileMaker’s recovery options into thinking there is an missing function referenced in the solution and therefore will report a false database structure error when performing a recover command with FileMaker Advanced on any database file that contains this code. Just something to look out for. Your database file is actually not corrupt. Removing the QR code custom functions will make everything alright. I wonder if there is another way of making this code work via scripts that would not have this issue.

    • Hi Tim,
      Thanks for the information. I hadn’t actually tried recovery on the file. That snafu is something I did not think of. Originally, I had a script that ran the plug-in’s RegisterGroovy function, but I wanted to make the code more self-contained without the need to copy scripts, only the custom functions. You can access the original file I created that uses the script instead, here:
      QR_Code V1.0
      I’m working on creating a QR Code using HTML5 that’s self-contained within FileMaker without the need to access an external API that’s over the Internet. Now, if I can just carve out some time…
      Matt

  24. Actually, I just used the new FileMaker 12 “Insert From URL” command and eliminated the need for ScriptMaster and one of the custom functions. All you need is the QRCodeURL function! Works great…and should eliminate any file recovery issues.

  25. Hi,
    I found following error: if you use URL’s wich include a “&” in the middle, then the WebViewer shows an incorrect result – but the Image is ok…
    Otherwise it works fine – thanks a lot!
    Andreas

    • Hi Andreas,
      Thanks for pointing that out. This would be important for some URL strings. I’ll try to replicate and see if we can solve the issue. I’ll also test and see if this is a problem for the QR Code that’s generated by the custom function in the container field.
      Thanks,
      Matt

  26. Matt, if I auto-enter the height and width pixel sizes, such as 140 each, yet have not entered any data in the Data field, why do I get a qr code as soon as I exit out of the field? Is it displaying the Google charting address as a qr code? How should I prevent that from displaying before entering in the Data field?

    • Hi Richard,
      Essentially, the QR Code generated is a null, empty, QR Code. You can change the container calculation to prevent the QR Code from being generated until you have a value in the data field. Something like this:
      ———–
      If (IsEmpty ( Data ); “”;
      QR_Code_Container ( Data ; Width ; Height ; Encoding ; ErrorCorrection ; Margin )
      )
      ———–
      Hope this helps and sorry for late reply,
      Matt

  27. Frank Diasparra says:

    Hi Matt,
    this appears to be an awesome solution for my upcoming application. Here’s some background & my question:

    My customers will have an existing QR code with an invoice number imbedded. that number will be the key to retrieve their data from my database. Once the QR is scanned it will be directed to my url which in turn needs to generate a find of their customer info via the invoice key and return it to them via SMS or EMAIL.

    My question: can I pass the QR info to your script and have it retrieve the info and send it back to them as described above? Apologies if I am missing the obvious, I am new to this stuff.

    Thanks
    Frank

  28. Thanks it worked supper on my project. I only got the google QR going, I´ll try to set up the other one. Thanks

  29. Hi Matt,
    I made an inventory list of our lab equipment using Filemaker Pro 11. I would like to generate a QR Code for each item; but I know very little to nothing about coding. What is a user-friendly way to do that and preferably with no additional cost associated to it?
    Thank you so much!
    Jo

    • Hello Jo,
      I would take a look at my sample file and implement it in your solution. The QR code will be generated based off the Data field. This could be a serial number in your inventory list of lab equipment or some other unique record identifier.
      Hope this helps,
      Matt

  30. Greetings Matt- Thanks for the creation of such as great tool! I’m using your sample file in my solution and have everything working but getting this error when I switch to the layout that contains your sample file.

    java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 400 for URL: http://chart.apis.google.com/chart?……….

    I click OK and everything still works. I just don’t want this error to pop up because it’s interrupting the print sequence I have set up. Any ideas?

    • Correction: It is printing but I don’t want the error to pop up. I’m using FMP 11.

    • Hi Jason,
      Thank you. As for the error, it’s probably caused by the data being sent to Google Charts. Let’s try to pinpoint the problem to the data or the calculation string. First, if you load your data into my sample file, does it produce the same error? If so, then look at how your data is constructed and see if there might be an illegal character that Java from Google’s Charts might not like. If you don’t get an error in my sample file, then check the calculation string in your file for the QR Code field.
      Let me know what you find out.
      Thanks,
      Matt

      • What we’ve done is wrote a script that when you click Print QR Code it inserts the contents of Field A into the QR_Data field, then populates the dimensions in the Height and Width then goes to a new layout which is set up to have the QR on a label then it prints the label. Could the problem be that we are auto generating the data field?

Speak Your Mind

*