0

I want to be able to tell a customer what their claim status is( by matching the number they call with to a number in the database with a corresponding claimprogress. So far I am able to return the callers number via the CustomerEndpoint address but can't seem to figure out how to take that CustomerEndpoint information and use it with RDS. I assume from my little python knowledge that an IF statement may work but have had no luck so far. enter image description here

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
  • What do you mean "can't use it with RDS" can you connect to RDS from the lambda? – Stefan Dec 10 '19 at 14:42
  • yeah sorry, when I test it I can retrieve the information from rds. However I can't seem to figure out how the information from the database can then be compared to the CustomerEndpoint number (which I can also retrive individually) in order to get the claim status – PythonSmython Dec 10 '19 at 14:51
  • Shouldn't you add a `WHERE phone_number = "customer number"` to your DB query instead of iterating through all the rows? – Stefan Dec 10 '19 at 15:01
  • Take a look at this answer on how to get the value from database object https://stackoverflow.com/questions/10195139/how-to-retrieve-sql-result-column-value-using-column-name-in-python – Stefan Dec 10 '19 at 15:08
  • I'm sorry, I dont understand? Can the CustomerEndPointAddress(customer number) is gathered through connect, am I able to reference that even if it is not a column name with the database – PythonSmython Dec 10 '19 at 15:09
  • Is CustomerEndPointAddress(customer number), it's not in your code? – Stefan Dec 10 '19 at 15:16
  • Sorry my bad the ['CustomerEndpoint']['Address'] that I have is correct. – PythonSmython Dec 10 '19 at 15:18
  • The value of `events["Details"]["ContactData"]...["Address"]` is a phone number right? And you want to get the claim number of a customer with that number right? – Stefan Dec 10 '19 at 19:55

0 Answers0