in CBHelper-evaluateCallBack/lambda_function.py [0:0]
def phone_lookup(phone, table):
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(table)
response = table.query(
KeyConditionExpression=Key('phoneNumber').eq(phone)
)
if (response['Count']):
print("Found contact:" + str(response['Items'][0]))
contactId = response['Items'][0]['contactId']
else:
print("Not contact found")
contactId = False
return contactId