Skip to content
Advertisement

Parse Json file in python and print response in dialogflow

I have a JSON file. I want to parse it and print the response in Dialogflow.

JavaScript

some JSON:

JavaScript

parse x:

JavaScript

Advertisement

Answer

Try this

JavaScript

Output:
South
Yes


Update : 1
Your json is an object. It is not array. Check this https://stackoverflow.com/a/38561016/2086966

So, you does not have to iterate with a for-loop.
Just use as follows

JavaScript




Update : 2

I guess this is the one you are searching for

JavaScript

Output
second Id -> 2
second Zone -> North
first Id -> 1
first Zone -> South

Here is the working code : https://onlinegdb.com/rJ4Ui3m0E


Update : 3

JavaScript

Output
bat

Here is the working code : https://onlinegdb.com/rJ41KyER4

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement