gopichandra commited on
Commit
78c5c14
·
verified ·
1 Parent(s): ca87bbb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -201,7 +201,9 @@ def interact_with_salesforce(mode, entry_type, quantity, extracted_text):
201
 
202
  attributes["Product name"] = product_name
203
 
 
204
  if mode == "Exit":
 
205
  query = f"SELECT Id, {field_name} FROM {object_name} WHERE {product_field_name} = '{product_name}' OR {model_field_name} = '{attributes.get('Model Name', '')}' LIMIT 1"
206
  response = sf.query(query)
207
 
 
201
 
202
  attributes["Product name"] = product_name
203
 
204
+ # If in "Exit" mode, we check if the product name or model name is already in Salesforce
205
  if mode == "Exit":
206
+ # Build query based on product name or model name
207
  query = f"SELECT Id, {field_name} FROM {object_name} WHERE {product_field_name} = '{product_name}' OR {model_field_name} = '{attributes.get('Model Name', '')}' LIMIT 1"
208
  response = sf.query(query)
209