Skip to content
Ask the community about this page

Calling a JSON service from Timextender Orchestration and Data Quality

In this article, you will read about calling a JSON service from Timextender Orchestration and Data Quality. In this example, we will use data from OpenWeatherMap.org.

Using JSON files or web services as Data Providers is handled with the PowerShell Data Provider. If the JSON data is located in a file on the server or accessible on a network drive, you can use "Get-Content" to retrieve the data.

Query text:

$items = Get-Content -Path C:\TEMP\JsonWeather.txt | ConvertFrom-Json

$items.list | Select-Object -Property name,visibility,@{label="temperature";expression={$_.main.temp}}

If the JSON data is accessible from the web, you can use "WebClient" to download the data. Query text:

$queryString = "https://samples.openweathermap.org/data/2.5/group?id=524901,703448,2643743&units=metric&appid=b6907d289e10d714a6e88b30761fae22"

$web_client = new-object system.net.webclient
$items = $web_client.DownloadString($queryString) | ConvertFrom-Json

$items.list | Select-Object -Property name,visibility,@{label="temperature";expression={$_.main.temp}}

Worked example

  1. Open Timextender Orchestration and Data Quality
  2. Click on 'New Query' on the homepage
  3. Name this query Weather

Calling a JSON service from Timextender Orchestration and Data Quality — screenshot 1

  1. Select the PowerShell Data Provider
  2. Paste the JSON query from the example above
  3. Click Execute

Calling a JSON service from Timextender Orchestration and Data Quality — screenshot 2

Discussed in the community

Looking for related questions…

Didn't find your answer? Ask the community about this page — questions are answered by Timextender experts, partners and other users.