Site icon Embarcadero RAD Studio, Delphi, & C++Builder Blogs

Spotlight: SurveyMonkey Enterprise Connector #ConnectTheData

As part of May’s Enterprise Connector Spotlight, I wanted to outline some of what you can do with the SurveyMonkey Enterprise Connector. We use SurveyMonkey here at Embarcadero for internal and external surveys. They have an option to get started for free, and a number of paid options. It is one of the more popular survey platforms. Even if you don’t currently use it, you’ve most likely taken a survey on their platform. You can find out more on SurveyMonkey’s website.

So what can you do with the SurveyMonkey Enterprise Connector? Glad you asked. The Enterprise Connector gives you SQL-based access to SurveyMonkey data through easy-to-use standards-based drivers. This means you can easily access live SurveyMonkey data from your own custom apps using all the power of FireDAC.

To get started with SurveyMonkey you can download the trial or the full version from CData’s website and follow the guide to connect. You will need a client ID and Secret API key from the SurveyMonkey developer portal. Be sure to set your callback URL, and scopes too. Then populate the values in the TFDConnection.


Setup your App on the SurveyMonkey developer portal


Be sure to specify the OAuth Redirect URL


Setup the Scopes you need. By default you need:
View Users, View Surveys, View Responses,
View Response Details, View Contacts, and View Collectors.


Change the CallbackURL, InitiateOAuth,
OAuthClientId, and OAuthClientSecret parameters.
You will probably want to set the RTK (Run-Time Key)
parameter and others as well.

If you take a look at the documentation on CData’s website. If you go down to the data model you can see a list of views provided by the Enterprise Connector. There are also some Stored Procedures used for authentication.

FireDAC Components for SurveyMonkey 2019 Views

Name Description
CollectorMessages Shows information regarding messages sent from a collector.
CollectorRecipients Shows information regarding recipients of all or specific messages sent from a collector.
Collectors Shows collector information.
CollectorStats Shows statistics regarding all or specific messages sent from a collector.
ContactLists Shows contact list information.
Contacts Shows contact information.
Pages Shows information regarding pages for a survey.
RollupQuestions Shows rolled up individual stats information for a survey.
Rollups Shows rolled up stats information for a survey.
SurveyQuestions Shows the available columns for Survey Questions. Append _Questions to your survey name to query survey questions.
SurveyResponses Shows the available columns for Survey Responses. Append _Responses to your survey name to query survey responses.

If you from there you can find out more about what data is available through each view. Note that SurveyQuestions and SurveyResponses don’t exist as views directly. Instead you look in those tables by using the name of the survey. So for example:

 

Fullscreen
1
2
3
SELECT * FROM [My Survey for Fun_Questions]
SELECT * FROM [Surbey about programming_Responses]
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[crayon-673fec158e26c048280116/]

To get a list of all the surveys and their individual tables you can do something like:

Fullscreen
1
2
FDSurveyMonkeyConnection.Open();
FDSurveyMonkeyConnection.GetTableNames(‘CDATA’,’surveymonkey’,”,ListBox1.Items);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

[crayon-673fec158e278271106215/]

And that’s all there is to accessing SurveyMonkey data in your C++Builder or Delphi application. Update Subscription customers who registered and attended the May 2019 webinar on this connector are eligible for a free one-year license. 

Exit mobile version