Skip to content

Commit

Permalink
Merge pull request #116 from rbw/feature/docs-usage-filtering
Browse files Browse the repository at this point in the history
Add field filter usage example
  • Loading branch information
rbw authored Jun 12, 2019
2 parents 8d544e8 + 9c8b901 commit 017150a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/full_examples/filtering.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Filtering fields
================

The `fields` parameter can be used for selecting which fields to return in the response.


.. code-block:: python
import pysnow
# Create client object
c = pysnow.Client(instance='myinstance', user='myusername', password='mypassword')
# Define a resource, here we'll use the incident table API
incident = c.resource(api_path='/table/incident')
# Query for incidents with state 3
response = incident.get(query={'state': 3}, fields=['sys_id', 'number', 'description'])
# Print out the first match
print(response.first())
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ ServiceNow HTTP client library written in Python.
full_examples/update
full_examples/delete
full_examples/sorting
full_examples/filtering
full_examples/oauth_client
full_examples/query_builder
full_examples/attachments
Expand Down

0 comments on commit 017150a

Please sign in to comment.