Click here to Skip to main content
15,897,273 members
Articles / Programming Languages / SQL
Article

Analyze Live Salesforce Data in Infragistics Reveal by Connecting through CData Cloud Hub or CData API Server

22 Feb 2020CPOL 5.6K  
In this article, we walk through connecting to Salesforce from CData Cloud Hub & CData API server and connecting to either product from Infragistics Reveal to create a simple dashboard.
Infragistics Reveal is a data visualization solution that makes it easier to add embedded analytics and visualizations to your apps. Reveal supports connecting to OData APIs, but many enterprise APIs are not built using the OData standard. By pairing Reveal with CData products you can quickly build dynamic dashboards from live enterprise data sources like Salesforce.

This article is in the Product Showcase section for our sponsors at CodeProject. These articles are intended to provide you with information on products and services that we consider useful and of value to developers.

With access to live data you can build real-time, responsive dashboards that retrieve new data points with every refresh. CData Cloud Hub and API Server let you generate standard data APIs like OData for all of your data, offering out-of-the-box connectivity to tools like Reveal. In this article, we walk through connecting to Salesforce from CData Cloud Hub & CData API server and connecting to either product from Infragistics Reveal to create a simple dashboard.

Why CData?

With CData Cloud Hub or CData API Server, you get a single point of contact for all of your enterprise data through standard data interfaces like SQL and OData. Instead of migrating data from dozens of sources to a static data store or writing your own integrations, simply point your tools to the Cloud Hub or API Server and get instant, live access to all of your data.

Why Cloud Hub?

As a cloud-based integration platform, Cloud Hub is ideal for working with cloud apps with embedded Reveal visualizations. Use the Web-based UI to create a virtual database for Salesforce, generate an OData API, and connect from Reveal to start building dashboards based on live Salesforce data. (Jump to Cloud Hub configuration.)

Why CData API Server?

CData API Server is installed on-premise or in a self-hosted environment and is useful for connecting to data from on-premise or self-hosted apps built on Reveal dashboards. Create an OData endpoint for Salesforce using the straightforward point-and-click interface and connect from Reveal to create dynamic Salesforce visualizations. (Jump to API Server configuration.)

Getting Started: Salesforce Connection Properties

To work with live Salesforce data in Reveal, you need to authenticate with Salesforce. There are several authentication methods available for connecting to Salesforce: Login, OAuth, and SSO. The Login method requires you to have the username, password, and security token of the user.

If you do not have access to the username and password or do not wish to require them, you can use OAuth authentication.

Use SSO (single sign-on) by setting the SSOProperties, SSOLoginUrl, and TokenUrl connection properties, which allow you to authenticate to an identity provider. See the "Getting Started" chapter in the help documentation for more information.

Using CData Cloud Hub

To connect to your Salesforce data in Cloud Hub and enable OData access, navigate to the web interface for your Cloud Hub instance (https://www.cdatacloud.net/myinstance). Follow the steps below to configure the Cloud Hub. (Jump to building a dashboard.)

Add a Cloud Hub User

Create a User to connect to Salesforce from Reveal through Cloud Hub.

  1. Click Users -> Add
  2. Configure a User
  3. Click Save Changes and make a note of the Authtoken for the new user

Connect to Salesforce from Cloud Hub

CData Cloud Hub uses a straightforward, point-and-click interface to connect to data sources and generate APIs.

  1. Open Cloud Hub and click Databases
  2. Select "Salesforce" from Available Data Sources
  3. Enter the necessary authentication properties to connect to Salesforce (see above)
  4. Click Test Database
  5. Click Privileges -> Add and add the new user (or an existing user) with the appropriate permissions (SELECT is the only required permission for Reveal)

Add Salesforce OData Endpoints in Cloud Hub

After connecting to Salesforce, create an OData Endpoint for the desired table(s).

  1. Click OData -> Tables -> Add Tables
  2. Select the Salesforce database
  3. Select the table(s) you wish to work with and click Next
  4. (Optional) Edit the resource to select specific fields and more
  5. Save the settings

(Optional) Configure Cross-Origin Resource Sharing (CORS)

When accessing and connecting to multiple different domains from an application such as Ajax, there is a possibility of violating the limitations of cross-site scripting. In that case, configure the CORS settings in OData -> Settings.

  • Enable cross-origin resource sharing (CORS): ON
  • Allow all domains without '*': ON
  • Access-Control-Allow-Methods: GET, PUT, POST, OPTIONS
  • Access-Control-Allow-Headers: Authorization

Save the changes to the settings.

Using API Server

To connect to your Salesforce data in API Server and enable OData access, navigate to the web interface for your API Server instance (https://localhost:8153). Follow the steps below to configure the API Server. (Jump to building a dashboard.)

Connect to Salesforce from API Server

CData API Server uses a straightforward, point-and-click interface to connect to data sources and generate APIs.

  1. Open API Server and click Settings -> Connection -> Add Connection
  2. Select "Salesforce"
  3. Enter the necessary authentication properties to connect to Salesforce (see above)

Add Salesforce Resource Definitions in API Server

After connecting to Salesforce, create Resources, which represent API endpoints for Salesforce data.

  1. Click Settings -> Resources -> Add Resource
  2. Select the Salesforce connection
  3. Select the table you wish to retrieve and click Next
  4. (Optional) Edit the resource to select specific fields and more
  5. Save the settings

Add an API Server User

Create a User to connect to Salesforce from Reveal through API Server.

  1. Click Settings -> Users
  2. Click Add
  3. Configure a User with access to the Salesforce Connection and Resource(s)
  4. Click Save Changes and make a note of the Authtoken for the new user

(Optional) Configure Cross-Origin Resource Sharing (CORS)

When accessing and connecting to multiple different domains from an application such as Ajax, there is a possibility of violating the limitations of cross-site scripting. In that case, configure the CORS settings in Settings -> Server.

  • Enable cross-origin resource sharing (CORS): ON
  • Allow all domains without '*': ON
  • Access-Control-Allow-Methods: GET, PUT, POST, OPTIONS
  • Access-Control-Allow-Headers: Authorization

Save the changes to the settings.

Create a Dashboard in Reveal

With the API Server configured, we can visualize Salesforce data in Reveal.

  1. Log into Reveal and click Dashboards -> New
  2. Click Data Source -> OData Feed
  3. Specify the API Server or Cloud Hub API endpoint URL, for example, https://serverurl/api.rsc
  4. Select Generic Credentials and specify the API Server username and authentication token
  5. Select the entity you wish to visualize
  6. Select fields and choose a chart type

More Information & Free Trial

At this point, you have created a simple dashboard from live Salesforce data. For more information on creating OData feeds from Salesforce (and more than 150 other sources), visit the Cloud Hub page or API Server page. Sign up for a demo of the Cloud Hub or download a free, 30-day trial of API Server and start working live Salesforce data in tools that consume OData APIs.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Writer CData Software
United States United States
I'm an educator-turned-technology evangelist, with a short stint as a software developer. In all of the work I've done, data has been critical, and as businesses, industries, and services grow, I can't help but notice the growth in the breadth and depth of data usage. A common interface to data frees enterprises from the burden of connecting to their data and frees them to focus on their own business. By leveraging CData drivers to access common SQL interfaces to more than 100 SaaS, Big Data, and NoSQL sources, developers can build solid, data-driven products and analysts and data scientists can quickly and easily build insights that drive business.

While giving presentations, writing articles, engaging in webinars, and producing tutorial videos I get the opportunity to see first-hand the difference that standard connectivity makes, with regards to both the underlying data sources and the tools and apps consuming the data. Talk to me about partnering with CData to connect to your own organization's data, embedding connectivity into your data-driven solutions or building custom connectors for a new data source.

Comments and Discussions

 
-- There are no messages in this forum --