AnsweredAssumed Answered

JSONGetElement Issue

Question asked by nathanwilcox on Apr 3, 2018
Latest reply on Apr 4, 2018 by beverly

Hi All,

 

My daughter has coeliacs disease and type 1 diabetes. Her treatment involves myself and my partner having to count carbs in all her meals and to cut out all traces of gluten.

 

For this I turned to Filemaker 16 Pro Advanced with a little knowledge of what I needed to create a system that would not only warn me if a product has gluten in it but also to work out the carbs that her meal had by calculating the weight of the products and adding them together to get a total.

 

I adapted the invoice starter solution to my needs and came out with a system that fits our needs perfectly. There was only one drawback... Manually having to enter all the products individual details in one by one.

 

Whilst trying to find the easiest and quickest approach to doing this in bulk I found that our supermarket, Tesco, has some API's that will help.

 

I now need a bit of help with the following functions I am hoping to add to my system. I have scoured the internet and google searched to the point I am now resorting to asking for help.

 

What I am trying to achieve:

Step 1: Enter Product name into "Item" field

Step 2: Press run button and have script run

Step 3: Script takes "Item" searches Tesco Grocery Search API for item and returns the products JSON which includes "tpnb" which is their item number

Step 4: Take "tpnb" and search Tesco Product Data API which gets all the products information in JSON format to populate as many of my other fields as possible

 

I can get the first script to run and it returns the JSON perfectly. The issue I have is using JSONGetElement to extract the "tpnb" I have used an online JSON Query tester to check and can get what I need but when I run it through Filemaker I don't get the same.

 

Here's my work:

Screen Shot 2018-04-03 at 19.11.58.png

Screen Shot 2018-04-03 at 19.13.08.png

 

Does anyone know why I can't get the data extracted?

 

Thanks

Outcomes