Articles → AUTOMATION ANYWHERE → Read Json Data In Automation Anywhere
Read Json Data In Automation Anywhere
Steps
- Create a python program to read json data.
- Open command prompt in automation anywhere.
- Execute the python program and put output in text file
- Read text file.
Create A Python Program To Read Json Data
import json
# some JSON:
x = '{ "name":"Karan", "age":37, "city":"Gurgaon"}'
# parse x:
y = json.loads(x)
print(y["name"])
print(y["age"])
print(y["city"])
Open Command Prompt In Automation Anywhere
Click to Enlarge
Execute The Python Program And Put Output In Text File
c:\python\python c:\temp\test.py > c:\temp\output.txt
- First parameter is the path of python.exe.
- Second parameter is the path of python file.
- Third parameter is the path of output file.
Click to Enlarge
Read Text File
Click to Enlarge
Click to Enlarge
Output
Click to Enlarge