Hi, I am putting together a “quick” POC for someone and I have a python code step that calls an api that returns the data in json format. All I am trying to do is return the data to be used in the next step which saves it to a Google Table. The json string should look something like this.
{
"game": {
"di": "left",
"gid": 2022200033,
"hid": 1612709911,
"st": "2023-01-01 20:00",
"tz": -5,
"vid": 1612709918,
"zn": "ET",
"generic": 0
},
"teams": t
{
"ab": "IWA",
"ci": "Iowa",
"colors": o
"#0C2340",
"#236192",
"#78BE21",
"#9EA2A2",
"#FFFFFF"
],
"logo":
"https://nbadatalakedev.blob.core.windows.net/nba/nba_sdk/assets/gleague_1612709911.png",
"na": "Wolves",
"tid": 1612709911,
"isHome": 1
},
{
"ab": "TEX",
"ci": "Texas",
"colors": o
"#0050B5",
"#0C2340",
"#8D9093",
"#FFFFFF"
],
"logo": "https://nbadatalakedev.blob.core.windows.net/nba/nba_sdk/assets/gleague_1612709918.png",
"na": "Legends",
"tid": 1612709918,
"isHome": 0
}
]
}
I have a teams table that I want to add the 2 teams to with a game id for each record appended. 1 row for each team. When I get tot he next step the data is parsed with with both team names in one field, both logos in another etc. When trying to add to the table it adds all the fields in one row.
I’m not sure how to just return the raw json string from the python code step. It seems Zapier is expecting dictionaries instead and I can’t pass those directly to Google Sheets.
I’m fairly new to Zapier and the process I am trying to put together will be edited and run by people who are not developers so I would like to use as little code as possible.
Any help would be greatly appreciated.
Thanks,
Rhonda