How to implement “Fetch Movie Data from Web Service” example

Tap Forms – Organizer Database App for Mac, iPhone, and iPad Forums Script Talk How to implement “Fetch Movie Data from Web Service” example


Viewing 8 reply threads
  • Author
  • March 1, 2021 at 11:57 AM #43646

    Ray Robillard

    Hi !

    I’ve created my movie database and now I’m ready to automate data entry with the script example “Fetch Movie Data from Web Service” found here : (near the bottom of the page)

    I’ve created the required fields which my database didn’t have (genre, link, barcode).

    I’ve copied the script from the web into a script attached to bar_code field. I’ve adapted the script so it uses my own database field IDs (so far, so good!)

    Synced the database with my iPhone. Added a new record, then tap on bar code field, used the scan bar code option and it actually scanned the bar code. However, no field were populated. So I manually checked the web url from where the data is fetched and I got this error :

    {“code”:”EXCEED_LIMIT”,”message”:”Rate limit exceeded”}

    The full URL is :

    Movie really exists and can be found on website. This is the link I get when I manually enter the UPC :

    So my questions :

    1) Did I do everything correctly ? Script attached to a field, and when data is entered in that field, the script is triggered and should search and find the metadata I need ?

    2) Is the website used in the sample still working ?



    You must be logged in to view attached files.
    March 1, 2021 at 12:27 PM #43649

    Ray Robillard

    Oops… made a few mistakes in my explanation :

    The script is NOT attached to bar code. It was attached to a different field. When I tried to attached it to bar code, I can’t get bar code to scan (it can’t be tapped).

    However, the error remains on the info website.

    So my questions :

    a) How to implement this
    b) does the website still works.

    March 1, 2021 at 4:02 PM #43651

    Daniel Leu

    The error message provides a hint: Rate limit exceeded

    Assuming you are using the free tier (, the limit is 100 combined requests / day. It looks like you have performed more requests than it is supported for the free tier.

    I would wait until tomorrow and try again. Otherwise, check that in your form you perform this lookup only once and not for all records.

    Using your link, I get a valid response. So this part of the code is correct:
    {"code":"OK","total":1,"offset":0,"items":[{"ean":"0786936203387","title":"Inspector Gadget 2 (DVD)","description":"Inspector Gadget 2 (DVD)","upc":"786936203387","brand":"Disney","model":"08966391","color":"Multi","size":"","dimension":"7.8 X 5.5 X 0.5 inches","weight":"0.3 Pounds","category":"Electronics > Video > Televisions","currency":"","lowest_recorded_price":0.01,"highest_recorded_price":88.88,"images":["","","","","","","","","",""],"offers":[{"merchant":"DealYard","domain":"","title":"INSPECTOR GADGET 2 (DVD/1.66)","currency":"","list_price":"","price":12.43,"shipping":"","condition":"New","availability":"","link":"","updated_t":1484913282},{"merchant":"Indigo Books & Music","domain":"","title":"Inspector Gadget 2","currency":"CAD","list_price":"","price":9.99,"shipping":"Free Shipping","condition":"New","availability":"Out of Stock","link":"","updated_t":1425355506},{"merchant":"","domain":"","title":"Inspector Gadget 2 (2003 / DVD)","currency":"","list_price":"","price":10.66,"shipping":"Free Shipping","condition":"New","availability":"","link":"","updated_t":1541678901},{"merchant":"Sears","domain":"","title":"Inspector Gadget 2 DVD","currency":"","list_price":"","price":7.99,"shipping":"","condition":"New","availability":"","link":"","updated_t":1425627944},{"merchant":"Rakuten(","domain":"","title":"Inspector Gadget 2","currency":"","list_price":"","price":11.18,"shipping":"","condition":"New","availability":"","link":"","updated_t":1590589921},{"merchant":"Best Buy","domain":"","title":"Inspector Gadget 2 [DVD] [2003]","currency":"","list_price":"","price":7.99,"shipping":"","condition":"New","availability":"","link":"","updated_t":1581124811},{"merchant":"","domain":"","title":"Inspector Gadget 2 (new)","currency":"","list_price":"","price":3.99,"shipping":"","condition":"New","availability":"","link":"","updated_t":1514927053},{"merchant":"","domain":"","title":"Inspector Gadget 2 (used)","currency":"","list_price":"","price":4.47,"shipping":"","condition":"New","availability":"","link":"","updated_t":1438967295},{"merchant":"","domain":"","title":"Inspector Gadget 2 (DVD)","currency":"","list_price":"","price":34.85,"shipping":"Free Shipping","condition":"New","availability":"Out of Stock","link":"","updated_t":1614631925},{"merchant":"Justice & Brothers","domain":"","title":"Inspector Gadget 2","currency":"","list_price":"","price":8.16,"shipping":"Free Shipping","condition":"New","availability":"Out of Stock","link":"","updated_t":1413349795},{"merchant":"Alibris","domain":"","title":"Inspector Gadget 2","currency":"","list_price":"","price":2.69,"shipping":"","condition":"New","availability":"","link":"","updated_t":1552399841},{"merchant":"Alibris UK","domain":"","title":"inspector gadget 2","currency":"GBP","list_price":"","price":5.69,"shipping":"","condition":"New","availability":"","link":"","updated_t":1552399372},{"merchant":"DVD Planet","domain":"","title":"Inspector Gadget 2 - DVD","currency":"","list_price":"","price":8.61,"shipping":"","condition":"New","availability":"","link":"","updated_t":1459397118},{"merchant":"Toys R Us","domain":"","title":"Inspector Gadget 2 DVD","currency":"","list_price":"","price":7.99,"shipping":"","condition":"New","availability":"","link":"","updated_t":1422850223},{"merchant":"Target","domain":"","title":"Inspector Gadget 2 (DVD), movies","currency":"","list_price":"","price":9.99,"shipping":"","condition":"New","availability":"","link":"","updated_t":1589179984},{"merchant":"11 Main","domain":"","title":"INSPECTOR GADGET 2","currency":"","list_price":"","price":10.9,"shipping":"","condition":"New","availability":"","link":"","updated_t":1437986473},{"merchant":"","domain":"","title":"Inspector Gadget 2 DVD/1.66","currency":"","list_price":"","price":10.52,"shipping":"","condition":"New","availability":"","link":"","updated_t":1484934730},{"merchant":"","domain":"","title":"Inspector Gadget 2 (DVD)","currency":"","list_price":"","price":5.85,"shipping":"","condition":"New","availability":"","link":"","updated_t":1484940186},{"merchant":"","domain":"","title":"Inspector Gadget 2","currency":"","list_price":"","price":7.99,"shipping":"","condition":"New","availability":"","link":"","updated_t":1536543457}],"asin":"B0000764K0","elid":"133512645732"}]}

    March 2, 2021 at 5:43 AM #43657

    Ray Robillard

    I tried again this morning, but I’m still getting the same error message. I’ll try later this afternoon, after a full 24 hours period. But you were right, the code was set to update records on save. Having 800 titles in my database, that could explain why I received the error message.

    That said, I still need help on how to implement this. Do I create a field script and put the code in and another field, bar_code, that I use to input the code (or use the camera on the iPhone)… ? So the script will be triggered when text is input in the bar_code field ?

    March 2, 2021 at 11:49 AM #43660

    Sam Moffatt

    The model I use when interacting with remote services that my script field updates another field and only runs if that other field doesn’t have a value. If something is wrong, I can empty out that field and it’ll repopulate it but it means that once that field is set, the script doesn’t poll the remote service. With 800 records and on save you’ll have blown through that quota the first time you saved and they’ll likely hold you to the 24 hour window. The main place I use this model is with a FOREX field for converting remote currency values to local currency (generally an approximation but usually close enough).

    The other pattern I do is to cache the responses locally and copy the response I get back and put it on a local web server (MacOS comes with Apache built in). Then I point my script to it and iterate on it until it behaves the way I want. In this situation that would have meant a request to get the sample response back and then once I’m done with development, I switch back to the real one. I also have some caching proxy for some endpoints to be able to capture API responses and also to quickly return identical requests.

    March 2, 2021 at 12:01 PM #43661

    Ray Robillard

    The model I use when interacting with remote services that my script field updates another field and only runs if that other field doesn’t have a value.

    In my case, I have a bar_code field which is empty at first, but gets populated after I use the camera to scan the UPC on the product. I want the search to run when that field is populated. How do I proceed ?

    The other pattern I do is to cache the responses locally and copy the response I get back and put it on a local web server (MacOS comes with Apache built in).

    This looks like a mock server and this is way over my league :) (last time I programmed something was probably for with Visual Basic 3 under Windows 3.1.. haha !)

    March 2, 2021 at 4:23 PM #43668

    Ray Robillard

    Found the answer to my question. When the Bar Code field gets a value, the script is executed automaticaly.

    And now, it’s working fine.

    March 2, 2021 at 11:31 PM #43670

    Sam Moffatt

    You want a field controlled by the script because if you do a recalculation, it’ll re-run all of the scripts in a record. If you recalc an entire form then it’ll check it for everything. If you’re checking if the bar code field is set to a value then you will hit the API again. That will mean that you’ll likely exceed the limit again and you’ll be waiting a day for things to be available again.

    For something like this you don’t need a full mock server, just copy and paste to a text file, point Apache at it (plenty of guides on how to do that out there) and then instead of pointing Tap Forms at the real source, you work against the saved file. More complex APIs a little harder but unless there is something truly dynamic in each request, you can get a sample page and use that to develop against.

    In any case glad to hear it’s working for you!

    March 3, 2021 at 11:33 PM #43680


    I’m glad you were able to figure it out.

    The trigger mechanism is that if you have a call to getFieldValue(some_field_id) in a Script field, Tap Forms will execute the script whenever the value of some_field_id is changed.

Viewing 8 reply threads

You must be logged in to reply to this topic.