function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Integrating Salesforce and Heroku with Salesforce Connect

Hi EveryOne,

Unable to execute the Apex adapter in Heroku Trailhead(

SandhyaSandhya (Salesforce Developers) 

You need to add method definition and return type as given in the module.

Please refer below code which is executing.
override global DataSource.TableResult query(DataSource.QueryContext queryContext) {
  List<Map<String, Object>> properties = DataSource.QueryUtils.process(queryContext, getProperties());
  DataSource.TableResult tableResult = DataSource.TableResult.get(queryContext, properties);
  return tableResult;

public List<Map<String, Object>> getProperties() {
  Http httpProtocol = new Http();
  HttpRequest request = new HttpRequest();
  String url = '';
  HttpResponse response = httpProtocol.send(request);

  List<Map<String, Object>> properties = new List<Map<String, Object>>();

  for (Object item : (List<Object>)JSON.deserializeUntyped(response.getBody())) {
    Map<String, Object> property = (Map<String, Object>)item;
    property.put('ExternalId', property.get('id'));
    property.put('DisplayUrl', '');
    property.put('Name', property.get('title'));

  return properties;

Hope this helps you!

Please mark it as Best Answer if my reply was helpful. It will make it available for other as the proper solution.
Thanks and Regards