Skip to main content

Calling a JSON service from TimeXtender Orchestration and Data Quality


Christian Hauggaard
Community Manager
Forum|alt.badge.img+5

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
  4. Select the PowerShell Data Provider
  5. Paste the JSON query from the example above
  6. Click Execute

     

Did this topic help you find an answer to your question?

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings