Panel API: Import data

The Import button allows you to send data from panels directly to your application.
This feature is available in tables and reference sections of the SCOUT interface, making it easier to integrate research findings into external tools.

In SCOUT, users can bookmark relevant content for later use. Similarly, in the API, the Import button enables data transmission from a panel to an application, allowing access to all the properties and fields visible in the panel view.

The data properties of imported items have been created for the corresponding front-end components and may change when new features are implemented. While we strive to maintain backward compatibility, we cannot guarantee it. Therefore, we recommend regularly testing and monitoring the availability of the data properties you rely on.

Test Import button

You can test the import functionality using the Panel API demo page:

  1. Open the Panel API demo page.
  2. Click the Import Data button.
  3. The imported data will be listed below, showing the transmitted response.

Implementation

Use the "message" event (https://developer.mozilla.org/en-US/docs/Web/API/Window/message_event) to receive our events"Mapegy_SendTableRow" and "Mapegy_SendReferenceItem"

You can also find implementation details in the source code of the Panel API demo page.

// listen to messages from child window
window.addEventListener("message", function (e) {
    if (e.origin + '/' == API_ENDPOINT && e.data) {
        switch (e.data.action) {
            case 'Mapegy_SendTableRow':
            case 'Mapegy_SendReferenceItem':
                // handle user-selected table row
                var responseContainer = document.getElementById('response-container');
                responseContainer.innerHTML = escapeHTML(JSON.stringify(e.data, null, 2)) + '<hr>' + responseContainer.innerHTML;
                break;

            case 'Mapegy_SendAPIPath':
                // open link from the interactive documentation (only needed for this demo application)
                requestPanel(e.data.data);
        }
    }
});

Example response for Mapegy_SendTableRow

{
  "action": "Mapegy_SendTableRow",
  "source": "news",
  "data": {
    "score_relevance": 0.9837,
    "title": "Artificial intelligence learned how to imitate human speech and gestures naturally",
    "description": "Teko­älyt|Artificial intelligence studied human gestures at Stanford University for a thousand hours. The virtual gesturer may be useful in animations and as an assistant in videos. The summary is...",
    "source": "observatorial.com",
    "published": "2025-01-04",
    "published_timestamp": 1736006559000,
    "mentions": [],
    "tags": [
      "General - news"
    ],
    "genres": [
      "GENERAL"
    ],
    "sector": "IT & Telecommunications",
    "url": "https://observatorial.com/news/technology-and-science/1153564/artificial-intelligence-learned-how-to-imitate-human-speech-and-gestures-naturally/",
    "inserted_timestamp": 1736225396000
  }
}

Example response for Mapegy_SendReferenceItem

{
  "action": "Mapegy_SendReferenceItem",
  "source": "research",
  "data": {
    "title": "A Universal Concurrent Framework for Fault Diagnosis in Processor Based Systems",
    "doc_id": 133368064,
    "topics": {
      "SECTOR": [],
      "SCIENCE": [],
      "INDUSTRY": [],
      "TECHNOLOGY": []
    },
    "abstract": "After acceptance of artificial intelligence paradigm, a number of successful artificial intelligence systems were created. The most successful area of artificial intelligence is knowledge based...",
    "doc_type": "SCIENCE",
    "web_links": {
      "homepage": "http://doi.org/10.1109/ca.2015.21"
    },
    "doc_sub_type": [
      "ARTICLE"
    ],
    "expert_names": [
      "Kodavade, D.V."
    ],
    "doc_timestamp": "2015-01-01 00:00:00 UTC",
    "score_relevance": 0.8337,
    "web_links_broken": {},
    "inserted_timestamp": "2024-11-17 15:09:17 UTC",
    "organization_names": []
  },
  "context": {
    "topic_ids": [
      5826928
    ]
  }
}
Related articles