Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

When you use a Web Service interface in a Data Retriever Connector applet to retrieve data, the interface generally returns a response in either XML or JSON format. If the interface returns a JSON object, you must understand the basic structure of JSON and how to navigate the object to extract the specific values you require.

...

The following Locators retrieve data from the JSON object above:

LocatorData ValueExplanation
isSuccessfultrueThe value of the isSuccessful property of the root object.
data.lastUpdated

"2015-07-11 22:34:16"

The value of the lastUpdated property of the data object.
data.contacts[0].name"Joe Dow"The value of the name property of the first member of the contacts array, which is a property of the data object.
data.contacts[1].subscriptions[2]"Finance"The value of the third member of the subscriptions array, property of the second member of the contacts array, property of the data object.
data.contacts[0].age37The value of the property age of the first member of the contacts array, which is a property of the data object.
data.contacts[1].agenullThe value of a non-existing property age of the second member of the contacts array, which is a property of the data object.
data.contacts[0].subscriptions"["Science", "Engineering", "IT", "Finance"]"The value of the subscriptions property of the first member of the contacts array, property of the data object.
Info

Locators pointing to non-existing object properties or array members will retrieve nullĀ during an interaction without any indication of a failure, thus allowing any expected value to be optional.

Locators pointing to a JSON object or a JSON array rather than a simple data type value will retrieve the whole object or array and allow saving it as plain text.