Home > Net >  if statement in python airtable records - json
if statement in python airtable records - json

Time:11-14

this are 3 records from airtable I want to make a for loop in python (if value in 'check' is Update2 - do something, else do something else)

   {'createdTime': '2022-11-09T15:57:28.000Z',
     'fields': {'Last Modified': '2022-11-10T00:22:31.000Z',
                'Name': 'Daniel',
                'Status': 'Todo',
                'check': 'update2'},
     'id': 'recbvBuBBrgWO98pZ'}
    {'createdTime': '2022-11-09T16:58:15.000Z',
     'fields': {'Last Modified': '2022-11-10T00:22:32.000Z',
                'Name': 'CLaudia',
                'Status': 'In progress',
                'check': 'update2'},
     'id': 'reck3BB7lOVKG0cPI'}
    {'createdTime': '2022-11-09T15:57:28.000Z',
     'fields': {'Last Modified': '2022-11-10T00:22:32.000Z',
                'Name': 'Isabella',
                'Status': 'Done',
                'check': 'update2'},
     'id': 'recveGd8w9ukxLkk9'}

enter image description here

CodePudding user response:

if record['fields']['check'] == 'update2':
    do something
else:
    do something else
  • Related