Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

JSON not found

patricklshan
6 - Meteoroid

My workflows can't find the JSON files. How can this be fixed?

2 REPLIES 2
gabrielvilella
14 - Magnetar

You need to add the JSON to a new column on the existing pandas dataframe then write it to an Alteryx anchor.

 

from ayx import Package
from ayx import Alteryx
try:
    import requests
except:
    Alteryx.installPackage('requests --user')

df = Alteryx.read('#1')
url = df.iloc[0,0]
page = requests.get(url)
df.json = page.text
df['json'] = df.json
Alteryx.write(df,1)

 

patricklshan
6 - Meteoroid

Thank you very much

Labels