Create Cvent-Connected Applications in Appsmith
Appsmith is an open-source internal tool builder that allows teams to quickly and easily build a UI to help improve their business operations. When combined with CData Connect AI, you gain immediate access to Cvent data for business applications. This article outlines the process of connecting to Cvent using Connect AI and creating a basic application from Cvent data within Appsmith.
CData Connect AI offers a pure SQL Server, cloud-to-cloud interface for Cvent, enabling the creation of business applications directly from live Cvent data within Appsmith, all without the need for data replication to a native database. As you build applications, Appsmith generates SQL queries to gather data. With its inherent optimized data processing capabilities, CData Connect AI efficiently channels all supported SQL operations, including filters and JOINs, directly to Cvent. This leverages server-side processing to swiftly deliver the requested Cvent data.
Configure Cvent Connectivity for Appsmith
Connectivity to Cvent from Appsmith is made possible through CData Connect AI. To work with Cvent data from Appsmith, we start by creating and configuring a Cvent connection.
- Log into Connect AI, click Sources, and then click Add Connection
- Select "Cvent" from the Add Connection panel
-
Enter the necessary authentication properties to connect to Cvent.
Before you can authenticate to Cvent, you must create a workspace and an OAuth application.
Creating a Workspace
To create a workspace:
- Sign into Cvent and navigate to App Switcher (the blue button in the upper right corner of the page) >> Admin.
- In the Admin menu, navigate to Integrations >> REST API.
- A new tab launches for Developer Management. Click on Manage API Access in the new tab.
- Create a Workspace and name it. Select the scopes you would like your developers to have access to. Scopes control what data domains the developer can access.
- Choose All to allow developers to choose any scope, and any future scopes added to the REST API.
- Choose Custom to limit the scopes developers can choose for their OAuth apps to selected scopes. To access all tables exposed by the driver, you need to set the following scopes:
event/attendees:read event/attendees:write event/contacts:read event/contacts:write event/custom-fields:read event/custom-fields:write event/events:read event/events:write event/sessions:delete event/sessions:read event/sessions:write event/speakers:delete event/speakers:read event/speakers:write budget/budget-items:read budget/budget-items:write exhibitor/exhibitors:read exhibitor/exhibitors:write survey/surveys:read survey/surveys:write
Creating an OAuth Application
After you have set up a Workspace and invited them, developers can sign up and create a custom OAuth app. See the Creating a Custom OAuth Application section in the Help documentation for more information.
Connecting to Cvent
After creating an OAuth application, set the following connection properties to connect to Cvent:
- InitiateOAuth: GETANDREFRESH. Used to automatically get and refresh the OAuthAccessToken.
- OAuthClientId: The Client ID associated with the OAuth application. You can find this on the Applications page in the Cvent Developer Portal.
- OAuthClientSecret: The Client secret associated with the OAuth application. You can find this on the Applications page in the Cvent Developer Portal.
- Click Save & Test
-
Navigate to the Permissions tab in the Add Cvent Connection page and update the User-based permissions.
Add a Personal Access Token
When connecting to Connect AI through the REST API, the OData API, or the Virtual SQL Server, a Personal Access Token (PAT) is used to authenticate the connection to Connect AI. It is best practice to create a separate PAT for each service to maintain granularity of access.
- Click on the Gear icon () at the top right of the Connect AI app to open the settings page.
- On the Settings page, go to the Access Tokens section and click Create PAT.
-
Give the PAT a name and click Create.
- The personal access token is only visible at creation, so be sure to copy it and store it securely for future use.
With the connection configured and a PAT generated, we are ready to connect to Cvent data from Appsmith.
Create an Appsmith Application from live Cvent Data
To establish a connection from Appsmith to the CData Connect AI Virtual SQL Server, follow these steps:
Connect to Cvent in Appsmith
- Log in to your Appsmith instance and create a new application.
-
In the new application, open the Data page and select Bring your data.
-
On this page, you can search for Microsoft SQL Server and select it as your data source.
-
Enter a name for the new data source and then enter the following connection settings:
- Host address: tds.cdata.com
- Port: 14333
- Database name: enter the Connection Name of the CData Connect AI data source you want to connect to (for example, Cvent1).
- Username: enter your CData Connect AI username. This is displayed in the top-right corner of the CData Connect AI interface. For example, [email protected].
- Password: enter the PAT you previously generated.
- Click Test configuration to confirm a successful connection, then click Save to save the datasource.
Create a new query
With a connection configured to a datasource, we can add a SQL query to actually retrieve data from the data source.
-
On the screen with the new data source, click New Query.
-
This opens the Query Editor to enter a SQL query to select data. To assist with specifying a SQL query, use the Explorer of CData Connect AI to preview the SQL queries and the data you want to retrieve.
-
After creating the SQL query, return to the Query Editor in Appsmith and enter the SQL query, then click Run.
- Once the query successfully runs, all that remains is to set up the Page to display the data retrieved.
Display Cvent data
-
Open the UI tab and click New UI element.
-
Choose a new UI element to grab, then drag and place the element on the page.
-
Click Connect data on the new UI element, then select the query previously created.
-
With the data connected, it is then displayed in the UI element.
Deploy the application
With the Cvent data connected to the UI elements in the application, we can deploy the Application. To do this, click Deploy in the top-right corner of Appsmith, then the application is opened in a separate window displaying the Cvent data.
Get CData Connect AI
To get live data access to 300+ SaaS, Big Data, and NoSQL sources directly from your cloud applications, try CData Connect AI today!