8. Add Value Accessor Set for SourceΒΆ
The source object is a JObject in the JArray created from the response. The value accessor set defines the values that are available in the JObject.
Note
Refer to the sample object below while configuring the value accessor set.
{
"source": {
"id": "lorem",
"name": "Lorem"
},
"author": "Lorem Ipsum",
"title": "Aliquam volutpat elit turpis, et rhoncus sapien maximus quis",
"description": "Aliquam lacus velit, eleifend quis leo vitae, condimentum cursus nisi.",
"url": "https://www.lipsum.com/feed/html",
"urlToImage": "http://via.placeholder.com/350x150",
"publishedAt": "2017-11-01T00:00:00Z"
}
In Sitecore, open Content Editor.
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Data Access > Value Accessor Sets > Providers.
Add RESTful Value Accessor Sets.
Hint
This template is a command template. It does not prompt for the item name. The command template assigns the item name automatically.
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Data Access > Value Accessor Sets > Providers > RESTful.
Add Token Value Accessor Set with the following field values:
Name
Value
Name
Article Values
Navigate to sitecore > system > Data Exchange > Data Exchange Tenant for News API > Data Access > Value Accessor Sets > Providers > RESTful > Article Values.
Add Token Value Accessor with the following field values:
Name
Value
Name
Source Id
Path Expression
source.id
Note
The path expression is made up of property names and array indexes separated by periods.
Add Token Value Accessor with the following field values:
Name
Value
Name
Source Name
Path Expression
source.name
Add Token Value Accessor with the following field values:
Name
Value
Name
Author
Path Expression
author
Add Token Value Accessor with the following field values:
Name
Value
Name
Title
Path Expression
title
Add Token Value Accessor with the following field values:
Name
Value
Name
Description
Path Expression
description
Add Token Value Accessor with the following field values:
Name
Value
Name
Url
Path Expression
url
Add Token Value Accessor with the following field values:
Name
Value
Name
Image Url
Path Expression
urlToImage
Add Token Value Accessor with the following field values:
Name
Value
Name
Published At
Path Expression
publishedAt