assigned_to
field is not getting filtered
Code:
__encoded_query = "assigned_toCONTAINSsteve"
Actually 2 records containing values with steve
but not returned with above code. Also related_records
field is not working with __encoded_query
assigned_to
field is not getting filtered
Code:
__encoded_query = "assigned_toCONTAINSsteve"
Actually 2 records containing values with steve
but not returned with above code. Also related_records
field is not working with __encoded_query
assigned_to
is a reference field, which stores the sys_id of the referenced sys_user record, but you're querying on what I assume is the display value (name
). If you want to query for records where the assigned_to
field refers to a user with a name that contains "steve", try dot-walking through the reference like this:
__encoded_query = "assigned_to.nameCONTAINSsteve"
For what it's worth, that could be a poorly performing query, you might be better off doing a STARTSWITH
query, which is more optimizable (from a database standpoint):
__encoded_query = "assigned_to.nameSTARTSWITHsteve"
Here's what the full SOAP request payload looks like in a test I just ran on a demo instance (where I didn't have any steves, but I had a Fred!):
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<getRecords xmlns="http://www.service-now.com/incident">
<__encoded_query xmlns="">assigned_to.nameSTARTSWITHfred</__encoded_query>
</getRecords>
</Body>
</Envelope>