You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.
I'm trying to figure out how to query a table in servicenow using either the "fetch_all" or "fetch_one" methods and use a "contains" like construct so that if I query for a street address I can just put in an address like '1234 Some Street' or I could I put in '1234 Some' and I would all the records with street names matching '1234 Some' - in case there were records with the abbreviation 'St' or 'Str', etc.
for record in results['records']:
try:
if record['__status'] == 'success':
print("Incident Location: " + record['name'])
pprint.pprint(record)
except KeyError:
print("Record not Found")
else:
print("Zero records found")
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm trying to figure out how to query a table in servicenow using either the "fetch_all" or "fetch_one" methods and use a "contains" like construct so that if I query for a street address I can just put in an address like '1234 Some Street' or I could I put in '1234 Some' and I would all the records with street names matching '1234 Some' - in case there were records with the abbreviation 'St' or 'Str', etc.
partial code listing below:
import pprint
sn_cmn_location = ServiceNow.Base(sn_conn)
sn_cmn_location.table = "cmn_location.do"
street = input("Street Address: ")
results = sn_cmn_location.fetch_all({'street': street})
if len(results['records']) > 0:
print("Records found: " + str(len(results['records'])))
The text was updated successfully, but these errors were encountered: