How can we help you today?

Map Results Function for ShortPoint Connections

ShortPoint Connect allows you to retrieve data dynamically from internal or external sources. While connections usually work immediately, you may encounter blank results or display issues when your source data format doesn't match ShortPoint's expected format.


The Map Results function can help you in these situations. This function is only available for the following ShortPoint connection types:



TABLE OF CONTENTS


Prerequisites


What Happens When Returned Data Is Incompatible with ShortPoint?

ShortPoint needs data to be returned as a list (called an array), but some data sources send information in other formats. When the format doesn't match what ShortPoint expects, the connection fails because ShortPoint cannot understand or display the data correctly.


For example, connecting to a REST API that provides the following data will not work as expected:

sample mismatched data format


Since the returned data is wrapped inside an object {} rather than an array [], ShortPoint cannot process it properly. Although this object contains an array with the correct values (result_data), ShortPoint cannot automatically identify this structure. If you check the ShortPoint fields, you'll notice that it fails to interpret the data structure from your REST API services.


Using the Map Results Function to Resolve Data Format Incompatibility

What is the Map Results Function?

The Map Results function executes after ShortPoint successfully connects to your data source but before passing the data to the ShortPoint element. It allows you to define how to process the returned data so it matches the format ShortPoint requires.


If you don't provide anything in the Map Results function, it will use the following default value:


default return value


This means the function will return the exact data received from the data source without any modification.

Considering the previous example, we need to pass the inner result_data array to the ShortPoint element, rather than the root object.


To solve this, we can simply write the following snippet inside the Map Results function:


configured map results


We should now see the right processed data displayed in the Data Example area once we establish the connection:


matched data format


How to Use the Map Results Function?

Follow the steps below on how to configure the data format using the Map Results function:


Step 1: Set up your connection

  • Switch to Grid Mode to access ShortPoint Connect (it's currently only available in Grid Mode).
  • In the Design Element settings, open the Connect tab.
  • Select a connection type.
  • Ensure that all the required fields are completed to establish a successful connection.


In our example, we are using the REST API connection type, and all we need to do is enter the URL.


REST API connection fields


Step 2: Enable Advanced Settings

Scroll down and look for the Enable Advanced Settings toggle. Switch it on.


enable advanced settings


Step 3: Update the Map Results field

Input your desired results display format in the Map Results field.


enter data format requirement


Step 4: Hit Connect

Once done, click the Connect button. You can then proceed to select the data you want to display in the Items tab and update your Design Element.


That is how you can configure the data source format to match what ShortPoint needs in any of the supported connection types.


Related articles:


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 36 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more