I'm trying to create a zap that uses Zapier Tables in conjunction with with a "Run Python in Code by Zapier" action.
The zap is not triggered by Tables, it’s triggered by something else, but the code in the Python action needs to read multiple rows from the table. (The idea is to make it easier to tweak some of the configuration of the zap by editing the table, rather than needing to modify the code.)
To do this, I created a “Find Records (Output as Line Items) in Zapier Tables” action before the Python action. The Tables action looks up rows based on data from the zap’s trigger, and seems to be finding the correct data.
The trouble is in getting this data to the Python code. Right now I have one of the “Input Data” fields in the Python action set to “Data” from the Tables action. The Python code then accesses it like this:
table_data = input_data.get('table_data', _])
I was hoping this would be either a list of objects, dicts, or even lists, or perhaps JSON. Instead it’s a single string containing the data formatted like this:
created_at: 2023-07-17T18:12:48.231000+00:00
data: {'f1': 'foo-bar', 'f2': 'howdy, folks.'}
edited_at: 2023-07-17T18:13:03.226760+00:00
errors: {}
id: 01H5JGW4F7ZFJMC1TNYYZNMYDA
schema_revision_id: 5
created_at: 2023-07-17T18:01:11.883000+00:00
data: {'f1': 'foo-bar', 'f2': 'hello, world!'}
edited_at: 2023-07-17T18:03:51.262171+00:00
errors: {}
id: 01H5JG6WEB9S557JRZHPKN3B36
schema_revision_id: 2
What format is this? This isn’t JSON or YAML, and I can’t find any documentation explaining what this is.
Is there a way I can get the table data (either the entire table or a subset consisting of multiple rows would be fine) in Python as a real data structure and not a flattened string?